diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index e92cdef..0000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: coverage - -on: - pull_request: - push: -jobs: - test: - name: coverage - runs-on: ubuntu-latest - container: - image: xd009642/tarpaulin:0.22.0 - options: --security-opt seccomp=unconfined - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Generate code coverage - run: | - cargo tarpaulin --verbose --workspace --timeout 120 --out Xml --avoid-cfg-tarpaulin - - name: Upload to codecov.io - uses: codecov/codecov-action@v2 - with: - token: ${{secrets.CODECOV_TOKEN}} - fail_ci_if_error: true diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml deleted file mode 100644 index 8f514a7..0000000 --- a/.github/workflows/e2e.yml +++ /dev/null @@ -1,94 +0,0 @@ -name: E2E Integration Tests - -on: - pull_request: - push: - branches: - - main - -jobs: - test: - name: E2E tests - runs-on: ubuntu-latest - env: - GAS_OUT_DIR: gas_reports - ENABLE_MAX_COLLECTION: true - GAS_LIMIT: 75000000 - steps: - - name: Checkout sources - uses: actions/checkout@v3 - - - name: Install latest toolchain - uses: dtolnay/rust-toolchain@stable - with: - toolchain: stable - targets: wasm32-unknown-unknown - - - name: Rust Dependencies Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - artifacts/ - key: ${{ runner.os }}-cargo-with-artifacts-${{ hashFiles('**/Cargo.lock') }} - - - name: Get mainnet GAS_LIMIT - run: echo "MAINNET_GAS_LIMIT=$(curl -s https://rpc.stargaze-apis.com/consensus_params | jq -r '.result.consensus_params.block.max_gas')" >> $GITHUB_ENV - - - name: Mainnet block GAS_LIMIT changed - if: ${{ env.MAINNET_GAS_LIMIT != env.GAS_LIMIT }} - uses: actions/github-script@v6 - with: - script: core.setFailed(`Integration tests must update GAS_LIMIT from ${process.env.GAS_LIMIT} to ${process.env.MAINNET_GAS_LIMIT}`) - - - name: Deploy local Stargaze node - run: make deploy-local - - - name: Optimize Contracts - run: make optimize - - - name: Run Integration Tests - run: make e2etest - - - name: Combine Test Gas Reports - run: cd e2e/ && jq -rs 'reduce .[] as $item ({}; . * $item)' gas_reports/*.json > gas_report.json - - - name: Raw Gas Report - run: cat e2e/gas_report.json - - - name: Set GIT_BRANCH - run: echo "GIT_BRANCH=$(echo ${{ github.ref }} | sed 's|/|-|g')" >> $GITHUB_ENV - - - name: Upload Gas Report - if: ${{ github.ref == 'refs/heads/main' }} - uses: actions/upload-artifact@v3 - with: - name: launchpad-gas-report-${{ env.GIT_BRANCH }} - path: e2e/gas_report.json - retention-days: 90 - - - name: Download main gas report - id: download_gas - # Because the max retention period of github artifacts is 90 days - # there's a possibility the main's report no longer exists - continue-on-error: true - if: ${{ github.ref != 'refs/heads/main' }} - # NOTE: We can't use github's `actions/download-artifact` because it doesnt support - # downloading an artifact cross workflows yet - # https://github.com/actions/download-artifact/issues/3 - uses: dawidd6/action-download-artifact@v2 - with: - branch: main - workflow: e2e.yml - name: launchpad-gas-report-refs-heads-main - - - name: Post gas diff to PR - if: ${{ github.ref != 'refs/heads/main' && steps.download_gas.outputs.found_artifact == 'true' }} - uses: de-husk/cosm-orc-gas-diff-action@v0.6.3 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - current_json: e2e/gas_report.json - old_json: gas_report.json diff --git a/contracts/headstash-contract/src/contract.rs b/contracts/headstash-contract/src/contract.rs index 34b0a92..c9da4f0 100644 --- a/contracts/headstash-contract/src/contract.rs +++ b/contracts/headstash-contract/src/contract.rs @@ -1,11 +1,10 @@ #[cfg(not(feature = "library"))] use cosmwasm_std::entry_point; use cosmwasm_std::{ - attr, to_binary, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdResult, - Uint128, Coin , BankMsg, CosmosMsg, + attr, coin,to_binary, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdResult, + Uint128, BankMsg, CosmosMsg, }; use cw2::{get_contract_version, set_contract_version}; -// use cw20_vesting::ExecuteMsg as Cw20ExecuteMsg; use crate::contract::validation::validate_claim; use sha2::Digest; use std::convert::TryInto; @@ -16,8 +15,8 @@ use crate::msg::{ MerkleRootResponse, MigrateMsg, QueryMsg, TotalClaimedResponse, }; use crate::state::{ - Config, NATIVE_FEE_DENOM, NATIVE_BOND_DENOM, CLAIM, CONFIG, MERKLE_ROOT, AIRDROP_START, AMOUNT_CLAIMED, - AIRDROP_DURATION, PAUSED, AMOUNT + Config, NATIVE_FEE_DENOM, NATIVE_BOND_DENOM, CLAIM, CONFIG, MERKLE_ROOT, AMOUNT_CLAIMED, + PAUSED, AMOUNT }; // Version info, for migration info @@ -48,7 +47,6 @@ pub fn instantiate( hex::decode_to_slice(&msg.merkle_root, &mut root_buf)?; MERKLE_ROOT.save(deps.storage, &msg.merkle_root)?; - AIRDROP_START.save(deps.storage, &msg.airdrop_start)?; // save total airdropped amount let amount = msg.total_amount.unwrap_or_else(Uint128::zero); @@ -77,11 +75,9 @@ pub fn execute( } } - - pub fn execute_claim( deps: DepsMut, - env: Env, + _env: Env, info: MessageInfo, eth_pubkey: String, eth_sig: String, @@ -89,18 +85,6 @@ pub fn execute_claim( proof: Vec, ) -> Result { - // airdrop begun - let start = AIRDROP_START.load(deps.storage)?; - if env.block.time.seconds() < start { - return Err(ContractError::NotBegun { start }); - } - // not expired - let duration = AIRDROP_DURATION.load(deps.storage)?; - let expiration = start + duration; - if env.block.time.seconds() > expiration { - return Err(ContractError::Expired { expiration }); - } - let is_paused = PAUSED.load(deps.storage)?; if is_paused { return Err(ContractError::Paused {}); @@ -158,16 +142,8 @@ pub fn execute_claim( let bank_msg = CosmosMsg::Bank(BankMsg::Send { to_address: info.sender.to_string(), - amount: vec![ - Coin { - denom: NATIVE_BOND_DENOM.to_string(), - amount: Uint128::new(12345), - }, - Coin { - denom: NATIVE_FEE_DENOM.to_string(), - amount: Uint128::new(67890), - }, - ], + amount: vec![coin(amount.u128(), NATIVE_BOND_DENOM), + coin(amount.u128(), NATIVE_FEE_DENOM),], }); let res = Response::new() @@ -182,7 +158,7 @@ pub fn execute_claim( pub fn execute_clawback( deps: DepsMut, - env: Env, + _env: Env, info: MessageInfo, _recipient: Option, ) -> Result { @@ -192,25 +168,6 @@ pub fn execute_clawback( if info.sender != cfg.owner { return Err(ContractError::Unauthorized {}) } - // authorize airdrop has started - let start = AIRDROP_START.load(deps.storage)?; - if env.block.time.seconds() < start { - return Err(ContractError::NotBegun { start }); - } - - // validate airdrop has not expired - let duration = AIRDROP_DURATION.load(deps.storage)?; - let expiration = start + duration; - deps.api.debug(&format!( - "now: {} then {}", - env.block.time.seconds(), - expiration - )); - if env.block.time.seconds() <= expiration { - return Err(ContractError::ClawBackUnavailable { - available_at: expiration, - }); - } // error if contract is paused let is_paused = PAUSED.load(deps.storage)?; @@ -240,7 +197,7 @@ pub fn execute_clawback( pub fn execute_pause( deps: DepsMut, - env: Env, + _env: Env, info: MessageInfo, ) -> Result { let cfg = CONFIG.load(deps.storage)?; @@ -248,24 +205,13 @@ pub fn execute_pause( return Err(ContractError::Unauthorized {}); } - let start = AIRDROP_START.load(deps.storage)?; - if env.block.time.seconds() < start { - return Err(ContractError::NotBegun { start }); - } - - let airdrop_duration = AIRDROP_DURATION.load(deps.storage)?; - let expiration = start + airdrop_duration; - if env.block.time.seconds() > expiration { - return Err(ContractError::Expired {expiration} ) - } - PAUSED.save(deps.storage, &true)?; Ok(Response::new().add_attributes(vec![attr("action", "pause"), attr("paused", "true")])) } pub fn execute_resume( deps: DepsMut, - env: Env, + _env: Env, info: MessageInfo, ) -> Result { // authorize owner @@ -274,17 +220,6 @@ pub fn execute_resume( return Err(ContractError::Unauthorized {}); } - let start = AIRDROP_START.load(deps.storage)?; - if env.block.time.seconds() < start { - return Err(ContractError::NotBegun { start }); - } - - let airdrop_duration = AIRDROP_DURATION.load(deps.storage)?; - let expiration = start + airdrop_duration; - if env.block.time.seconds() > expiration { - return Err(ContractError::Expired { expiration }); - } - let is_paused = PAUSED.load(deps.storage)?; if !is_paused { return Err(ContractError::NotPaused {}); @@ -316,14 +251,10 @@ pub fn query_config(deps: Deps) -> StdResult { pub fn query_merkle_root(deps: Deps) -> StdResult { let merkle_root = MERKLE_ROOT.load(deps.storage)?; - let airdrop_start = AIRDROP_START.load(deps.storage)?; - let airdrop_duration = AIRDROP_DURATION.load(deps.storage)?; let total_amount = AMOUNT.load(deps.storage)?; let resp = MerkleRootResponse { merkle_root, - airdrop_start, - airdrop_duration, total_amount, }; @@ -419,405 +350,3 @@ mod validation { } } } - - - - -// #[cfg(test)] -// mod tests { -// use super::*; -// use cosmwasm_std::testing::{mock_dependencies, mock_env, mock_info}; -// use cosmwasm_std::{from_binary}; -// use serde::Deserialize; - -// #[test] -// fn proper_instantiation() { -// let mut deps = mock_dependencies(); - -// let msg = InstantiateMsg { -// owner: Some("owner0000".to_string()), -// claim_msg_plaintext: "{address}".to_string(), -// }; - -// let env = mock_env(); -// let info = mock_info("{address}", &[]); - -// // we can just call .unwrap() to assert this was a success -// let _res = instantiate(deps.as_mut(), env.clone(), info, msg).unwrap(); - -// // it worked, let's query the state -// let res = query(deps.as_ref(), env.clone(), QueryMsg::Config {}).unwrap(); -// let config: ConfigResponse = from_binary(&res).unwrap(); -// assert_eq!("owner0000", config.owner.unwrap().as_str()); -// assert_eq!("{address}", config.claim_msg_plaintext.as_str()); -// } - -// // #[test] -// // fn update_config() { -// // let mut deps = mock_dependencies(); - -// // let msg = InstantiateMsg { -// // owner: None, -// // claim_msg_plaintext: "{address}".to_string(), -// // }; - -// // let env = mock_env(); -// // let info = mock_info("owner0000", &[]); -// // let _res = instantiate(deps.as_mut(), env, info, msg).unwrap(); - -// // // update owner -// // let env = mock_env(); -// // let info = mock_info("owner0000", &[]); -// // let msg = ExecuteMsg::UpdateConfig { -// // new_owner: Some("owner0001".to_string()), -// // }; - -// // let res = execute(deps.as_mut(), env.clone(), info, msg).unwrap(); -// // assert_eq!(0, res.messages.len()); - -// // // it worked, let's query the state -// // let res = query(deps.as_ref(), env, QueryMsg::Config {}).unwrap(); -// // let config: ConfigResponse = from_binary(&res).unwrap(); -// // assert_eq!("owner0001", config.owner.unwrap().as_str()); - -// // // Unauthorized err -// // let env = mock_env(); -// // let info = mock_info("owner0000", &[]); -// // let msg = ExecuteMsg::UpdateConfig { new_owner: None }; - -// // let res = execute(deps.as_mut(), env, info, msg).unwrap_err(); -// // assert_eq!(res, ContractError::Unauthorized {}); -// // } - -// // const TEST_DATA_1: &[u8] = include_bytes!("../testdata/airdrop_stage_1_test_data.json"); -// // const TEST_DATA_2: &[u8] = include_bytes!("../testdata/airdrop_stage_2_test_data.json"); - -// // #[derive(Deserialize, Debug)] -// // struct Encoded { -// // account: String, -// // amount: Uint128, -// // root: String, -// // proofs: Vec, -// // } - -// // #[test] -// // fn claim() { -// // // Run test 1 -// // let mut deps = mock_dependencies(); -// // let test_data: Encoded = from_slice(TEST_DATA_1).unwrap(); - -// // let msg = InstantiateMsg { -// // owner: Some("owner0000".to_string()), -// // cw20_token_address: "token0000".to_string(), -// // }; - -// // let env = mock_env(); -// // let info = mock_info("addr0000", &[]); -// // let _res = instantiate(deps.as_mut(), env, info, msg).unwrap(); - -// // let env = mock_env(); -// // let info = mock_info("owner0000", &[]); -// // let msg = ExecuteMsg::default_merkle_root(test_data.root); -// // let _res = execute(deps.as_mut(), env, info, msg).unwrap(); - -// // let msg = ExecuteMsg::Claim { -// // amount: test_data.amount, -// // stage: 1u8, -// // proof: test_data.proofs, -// // }; - -// // let env = mock_env(); -// // let info = mock_info(test_data.account.as_str(), &[]); -// // let res = execute(deps.as_mut(), env.clone(), info.clone(), msg.clone()).unwrap(); -// // let expected = SubMsg::new(CosmosMsg::Wasm(WasmMsg::Execute { -// // contract_addr: "token0000".to_string(), -// // funds: vec![], -// // msg: to_binary(&Cw20ExecuteMsg::Transfer { -// // recipient: test_data.account.clone(), -// // amount: test_data.amount, -// // }) -// // .unwrap(), -// // })); -// // assert_eq!(res.messages, vec![expected]); - -// // assert_eq!( -// // res.attributes, -// // vec![ -// // attr("action", "claim"), -// // attr("stage", "1"), -// // attr("address", test_data.account.clone()), -// // attr("amount", test_data.amount) -// // ] -// // ); - -// // // Check total claimed on stage 1 -// // let claimed = query_total_claimed(deps.as_ref(), 1).unwrap(); -// // assert_eq!(claimed.claimed, test_data.amount); - -// // // Check address is claimed -// // let is_claimed = query_is_claimed(deps.as_ref(), 1, test_data.account).unwrap(); -// // assert!(is_claimed.is_claimed); - -// // // check error on double claim -// // let res = execute(deps.as_mut(), env, info, msg).unwrap_err(); -// // assert_eq!(res, ContractError::Claimed {}); - -// // // Second test -// // let test_data: Encoded = from_slice(TEST_DATA_2).unwrap(); - -// // // register new drop -// // let env = mock_env(); -// // let info = mock_info("owner0000", &[]); -// // let msg = ExecuteMsg::default_merkle_root(test_data.root); -// // let _res = execute(deps.as_mut(), env, info, msg).unwrap(); - -// // // Claim next airdrop -// // let msg = ExecuteMsg::Claim { -// // amount: test_data.amount, -// // stage: 2u8, -// // proof: test_data.proofs, -// // }; - -// // let env = mock_env(); -// // let info = mock_info(test_data.account.as_str(), &[]); -// // let res = execute(deps.as_mut(), env, info, msg).unwrap(); -// // let expected: SubMsg<_> = SubMsg::new(CosmosMsg::Wasm(WasmMsg::Execute { -// // contract_addr: "token0000".to_string(), -// // funds: vec![], -// // msg: to_binary(&Cw20ExecuteMsg::Transfer { -// // recipient: test_data.account.clone(), -// // amount: test_data.amount, -// // }) -// // .unwrap(), -// // })); -// // assert_eq!(res.messages, vec![expected]); - -// // assert_eq!( -// // res.attributes, -// // vec![ -// // attr("action", "claim"), -// // attr("stage", "2"), -// // attr("address", test_data.account), -// // attr("amount", test_data.amount) -// // ] -// // ); - -// // // Check total claimed on stage 2 -// // let claimed = query_total_claimed(deps.as_ref(), 2).unwrap(); -// // assert_eq!(claimed.claimed, test_data.amount); -// // } - -// // const TEST_DATA_1_MULTI: &[u8] = -// // include_bytes!("../testdata/airdrop_stage_1_test_multi_data.json"); - -// // #[derive(Deserialize, Debug)] -// // struct Proof { -// // account: String, -// // amount: Uint128, -// // proofs: Vec, -// // } - -// // #[derive(Deserialize, Debug)] -// // struct MultipleData { -// // total_amount: Uint128, -// // total_claimed_amount: Uint128, -// // root: String, -// // accounts: Vec, -// // } - -// // #[test] -// // fn multiple_claim() { -// // // Run test 1 -// // let mut deps = mock_dependencies(); -// // let test_data: MultipleData = from_slice(TEST_DATA_1_MULTI).unwrap(); - -// // let msg = InstantiateMsg { -// // owner: Some("owner0000".to_string()), -// // cw20_token_address: "token0000".to_string(), -// // }; - -// // let env = mock_env(); -// // let info = mock_info("addr0000", &[]); -// // let _res = instantiate(deps.as_mut(), env, info, msg).unwrap(); - -// // let env = mock_env(); -// // let info = mock_info("owner0000", &[]); -// // let msg = ExecuteMsg::register_merkle_root( -// // test_data.root, -// // test_data.total_amount.u128(), -// // None, -// // None, -// // None, -// // ); -// // let _res = execute(deps.as_mut(), env, info, msg).unwrap(); - -// // // Loop accounts and claim -// // for account in test_data.accounts.iter() { -// // let msg = ExecuteMsg::Claim { -// // amount: account.amount, -// // stage: 1u8, -// // proof: account.proofs.clone(), -// // }; - -// // let env = mock_env(); -// // let info = mock_info(account.account.as_str(), &[]); -// // let res = execute(deps.as_mut(), env.clone(), info.clone(), msg.clone()).unwrap(); -// // let expected = SubMsg::new(CosmosMsg::Wasm(WasmMsg::Execute { -// // contract_addr: "token0000".to_string(), -// // funds: vec![], -// // msg: to_binary(&Cw20ExecuteMsg::Transfer { -// // recipient: account.account.clone(), -// // amount: account.amount, -// // }) -// // .unwrap(), -// // })); -// // assert_eq!(res.messages, vec![expected]); - -// // assert_eq!( -// // res.attributes, -// // vec![ -// // attr("action", "claim"), -// // attr("stage", "1"), -// // attr("address", account.account.clone()), -// // attr("amount", account.amount) -// // ] -// // ); -// // } - -// // // Check total claimed on stage 1 -// // let totals = query_total_claimed(deps.as_ref(), 1).unwrap(); -// // assert_eq!(totals.claimed, test_data.total_claimed_amount); -// // assert_eq!(totals.total, test_data.total_amount); -// // } - -// // Check expiration. Chain height in tests is 12345 - - - -// // #[test] -// // fn can_clawback() { -// // let mut deps = mock_dependencies(); -// // let test_data: Encoded = from_slice(TEST_DATA_1).unwrap(); - -// // let msg = InstantiateMsg { -// // owner: Some("owner0000".to_string()), -// // claim_msg_plaintext: "{address}".to_string(), -// // }; -// // let info = mock_info("addr0000", &[]); -// // instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); - -// // let info = mock_info("owner0000", &[]); -// // let msg = ExecuteMsg::RegisterMerkleRoot { -// // merkle_root: test_data.root, -// // expiration: Expiration::AtHeight(12500), -// // start: ExecuteMsg::default_start(), -// // total_amount: Uint128::new(10000), -// // }; -// // execute(deps.as_mut(), mock_env(), info, msg).unwrap(); - -// // let mut env = mock_env(); -// // env.block.height = 10000; - -// // // cannot yet clawback -// // let msg = ExecuteMsg::ClawBack { -// // stage: 1, -// // recipient: "buddy".to_string(), -// // }; -// // let info = mock_info("owner0000", &[]); -// // let err = execute(deps.as_mut(), env.clone(), info.clone(), msg.clone()).unwrap_err(); -// // assert_eq!( -// // err, -// // ContractError::StageNotExpired { -// // stage: 1, -// // expiration: Expiration::AtHeight(12500) -// // } -// // ); - -// // // makes the stage expire -// // env.block.height = 12501; - -// // // Can clawback after expired stage -// // let res = execute(deps.as_mut(), env, info, msg).unwrap(); - -// // let expected = SubMsg::new(CosmosMsg::Wasm(WasmMsg::Execute { -// // contract_addr: "token0000".to_string(), -// // funds: vec![], -// // msg: to_binary(&Cw20ExecuteMsg::Transfer { -// // recipient: "buddy".to_string(), -// // amount: Uint128::new(10000), -// // }) -// // .unwrap(), -// // })); -// // assert_eq!(res.messages, vec![expected]); - -// // assert_eq!( -// // res.attributes, -// // vec![ -// // attr("action", "clawback"), -// // attr("recipient", "buddy"), -// // attr("stage", "1"), -// // attr("address", "owner0000"), -// // attr("amount", Uint128::new(10000)), -// // ] -// // ); -// // } - - -// // #[test] -// // fn owner_freeze() { -// // let mut deps = mock_dependencies(); - -// // let msg = InstantiateMsg { -// // owner: Some("owner0000".to_string()), -// // claim_msg_plaintext: "{address}".to_string(), -// // }; - -// // let env = mock_env(); -// // let info = mock_info("addr0000", &[]); -// // let _res = instantiate(deps.as_mut(), env, info, msg).unwrap(); - -// // // can register merkle root -// // let env = mock_env(); -// // let info = mock_info("owner0000", &[]); -// // let msg = ExecuteMsg::default_merkle_root( -// // "5d4f48f147cb6cb742b376dce5626b2a036f69faec10cd73631c791780e150fc", -// // ); -// // let _res = execute(deps.as_mut(), env, info, msg).unwrap(); - -// // // can update owner -// // let env = mock_env(); -// // let info = mock_info("owner0000", &[]); -// // let msg = ExecuteMsg::UpdateConfig { -// // new_owner: Some("owner0001".to_string()), -// // }; - -// // let res = execute(deps.as_mut(), env, info, msg).unwrap(); -// // assert_eq!(0, res.messages.len()); - -// // // freeze contract -// // let env = mock_env(); -// // let info = mock_info("owner0001", &[]); -// // let msg = ExecuteMsg::UpdateConfig { new_owner: None }; - -// // let res = execute(deps.as_mut(), env, info, msg).unwrap(); -// // assert_eq!(0, res.messages.len()); - -// // // cannot register new drop -// // let env = mock_env(); -// // let info = mock_info("owner0001", &[]); -// // let msg = ExecuteMsg::default_merkle_root( -// // "ebaa83c7eaf7467c378d2f37b5e46752d904d2d17acd380b24b02e3b398b3e5a", -// // ); -// // let res = execute(deps.as_mut(), env, info, msg).unwrap_err(); -// // assert_eq!(res, ContractError::Unauthorized {}); - -// // // cannot update config -// // let env = mock_env(); -// // let info = mock_info("owner0001", &[]); -// // let msg = ExecuteMsg::UpdateConfig { -// // new_owner: Some("mememe".to_string()), -// // }; -// // let res = execute(deps.as_mut(), env, info, msg).unwrap_err(); -// // assert_eq!(res, ContractError::Unauthorized {}); -// // } -// } diff --git a/contracts/headstash-contract/src/msg.rs b/contracts/headstash-contract/src/msg.rs index 03cb37c..2c5dfd7 100644 --- a/contracts/headstash-contract/src/msg.rs +++ b/contracts/headstash-contract/src/msg.rs @@ -10,8 +10,6 @@ pub struct InstantiateMsg { pub claim_msg_plaintext: String, /// merkle root pub merkle_root: String, - /// start time - pub airdrop_start: u64, /// total amount pub total_amount: Option, } @@ -56,8 +54,6 @@ pub struct ConfigResponse { pub struct MerkleRootResponse { /// MerkleRoot is hex-encoded merkle root. pub merkle_root: String, - pub airdrop_start: u64, - pub airdrop_duration: u64, pub total_amount: Uint128, } diff --git a/contracts/headstash-contract/src/state.rs b/contracts/headstash-contract/src/state.rs index 845b625..fe78621 100644 --- a/contracts/headstash-contract/src/state.rs +++ b/contracts/headstash-contract/src/state.rs @@ -15,12 +15,6 @@ pub const CONFIG: Item = Item::new("config"); pub const NATIVE_FEE_DENOM: &str = "uterp"; pub const NATIVE_BOND_DENOM: &str = "uthiol"; -pub const AIRDROP_START_KEY: &str = "airdrop_start"; -pub const AIRDROP_START: Item = Item::new(AIRDROP_START_KEY); - -pub const AIRDROP_DURATION_KEY: &str = "vesting_duration_key"; -pub const AIRDROP_DURATION: Item = Item::new(AIRDROP_DURATION_KEY); - // saves external network airdrop accounts pub const ACCOUNT_MAP_KEY: &str = "account_map"; // external_address -> host_address