Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dYdX Airdrop updates #652

Merged

Conversation

MightOfOaks
Copy link
Member

No description provided.

Copy link

github-actions bot commented Jan 30, 2024

Cosm-Orc Gas Usage

Contract Op Name Gas Used Old Gas Used Gas Diff File
multiple_contracts Execute__minter_batch_exec_mint_token_w_trading_time 3159681 1951399 +61.9188% e2e/src/tests/open_edition_factory_and_mint_tests.rs:497
open_edition_factory Store__Store 3813089 3506900 +8.7310% e2e/src/helpers/chain.rs:78
vending_factory Store__Store 3408347 3082476 +10.5717% e2e/src/helpers/chain.rs:78
base_factory Store__Store 2989591 2696792 +10.8573% e2e/src/helpers/chain.rs:78
base_minter Store__Store 7166934 7068056 +1.3989% e2e/src/helpers/chain.rs:78
open_edition_minter Store__Store 8819481 8700070 +1.3725% e2e/src/helpers/chain.rs:78
sg721_base Store__Store 8525902 8416494 +1.2999% e2e/src/helpers/chain.rs:78
sg721_metadata_onchain Store__Store 8983749 8886444 +1.0950% e2e/src/helpers/chain.rs:78
sg721_nt Store__Store 7947246 7842375 +1.3372% e2e/src/helpers/chain.rs:78
sg721_updatable Store__Store 9332175 9204723 +1.3846% e2e/src/helpers/chain.rs:78
sg_whitelist Store__Store 3711208 3599317 +3.1087% e2e/src/helpers/chain.rs:78
sg_whitelist_flex Store__Store 3647157 3528506 +3.3626% e2e/src/helpers/chain.rs:78
vending_minter Store__Store 9022424 8892840 +1.4572% e2e/src/helpers/chain.rs:78
vending_minter_merkle_wl Store__Store 9270919 9138800 +1.4457% e2e/src/helpers/chain.rs:78
vending_minter_wl_flex Store__Store 9202084 9075906 +1.3903% e2e/src/helpers/chain.rs:78
whitelist_immutable Store__Store 2275917 2206354 +3.1528% e2e/src/helpers/chain.rs:78
whitelist_mtree Store__Store 7161494 7025364 +1.9377% e2e/src/helpers/chain.rs:78
Raw Report for 5f1ed3e
Contract Op Name Gas Used Gas Wanted File
minter Execute__minter_exec_mint_to_token 365558 525213 e2e/src/tests/open_edition_minter_executes_tests.rs:181
minter Execute__minter_exec_purge 140239 187293 e2e/src/tests/open_edition_minter_executes_tests.rs:282
minter Execute__minter_exec_update_per_addr_limit 209881 291704 e2e/src/tests/open_edition_minter_executes_tests.rs:217
minter Execute__minter_exec_update_trading_time 271497 384126 e2e/src/tests/open_edition_minter_executes_tests.rs:100
multiple_contracts Execute__minter_batch_exec_mint_token 3158398 4714736 e2e/src/tests/open_edition_factory_and_mint_tests.rs:276
multiple_contracts Execute__minter_batch_exec_mint_token_w_trading_time 3159681 4716656 e2e/src/tests/open_edition_factory_and_mint_tests.rs:497
open_edition_factory Execute__factory_exec_minter_inst 547482 798098 e2e/src/tests/open_edition_factory_and_mint_tests.rs:206
open_edition_factory Instantiate__factory_inst 188238 259239 e2e/src/helpers/open_edition_minter_helpers.rs:39
open_edition_factory Execute__factory_exec_minter_inst_w_trading_time 548193 799166 e2e/src/tests/open_edition_factory_and_mint_tests.rs:411
open_edition_factory Store__Store 3813089 5696493 e2e/src/helpers/chain.rs:78
vending_factory Execute__factory_exec_minter_inst_w_trading_time 3858641 5764763 e2e/src/tests/factory_test.rs:244
vending_factory Instantiate__factory_inst 187315 257855 e2e/src/helpers/helper.rs:35
vending_factory Execute__factory_exec_minter_inst 34037888 51033620 e2e/src/tests/factory_test.rs:98
vending_factory Store__Store 3408347 5089380 e2e/src/helpers/chain.rs:78
base_factory Store__Store 2989591 4461246 e2e/src/helpers/chain.rs:78
base_minter Store__Store 7166934 10727201 e2e/src/helpers/chain.rs:78
dydx_airdrop Store__Store 4317996 6453854 e2e/src/helpers/chain.rs:78
open_edition_minter Store__Store 8819481 13206021 e2e/src/helpers/chain.rs:78
sg721_base Store__Store 8525902 12765653 e2e/src/helpers/chain.rs:78
sg721_metadata_onchain Store__Store 8983749 13452423 e2e/src/helpers/chain.rs:78
sg721_nt Store__Store 7947246 11897669 e2e/src/helpers/chain.rs:78
sg721_updatable Store__Store 9332175 13975062 e2e/src/helpers/chain.rs:78
sg_whitelist Store__Store 3711208 5543672 e2e/src/helpers/chain.rs:78
sg_whitelist_flex Store__Store 3647157 5447595 e2e/src/helpers/chain.rs:78
vending_minter Store__Store 9022424 13510436 e2e/src/helpers/chain.rs:78
vending_minter_featured Store__Store 9105780 13635470 e2e/src/helpers/chain.rs:78
vending_minter_merkle_wl Store__Store 9270919 13883178 e2e/src/helpers/chain.rs:78
vending_minter_wl_flex Store__Store 9202084 13779926 e2e/src/helpers/chain.rs:78
vending_minter_wl_flex_featured Store__Store 9119469 13656003 e2e/src/helpers/chain.rs:78
whitelist_immutable Store__Store 2275917 3390735 e2e/src/helpers/chain.rs:78
whitelist_immutable_flex Store__Store 2288722 3409943 e2e/src/helpers/chain.rs:78
whitelist_mtree Store__Store 7161494 10719036 e2e/src/helpers/chain.rs:78

Ok(res)
}

pub fn dust_and_whitelist_add(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can just be whitelist_add and call the dust( ) function from the calling function

@@ -19,158 +15,21 @@ pub fn claim_airdrop(
eth_sig: String,
) -> Result<Response, ContractError> {
let config = CONFIG.load(deps.storage)?;
let airdrop_count_limit = config.airdrop_count_limit;
if AIRDROP_COUNT.load(deps.storage)? >= airdrop_count_limit {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be a one line assert check

Ok(())
}

pub fn check_previous_claim(deps: &DepsMut, eth_address: &str) -> Result<(), ContractError> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't a "previous claim" just be the address to mint count matches the max airdrop amount or do we need to track something different?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the reward is being claimed currently. Not tracking a mint count. The user is expected to mint the token outside of the airdrop contract through the regular minting process.

@@ -37,6 +37,7 @@ fn query_minter_as_expected(app: &mut StargazeApp, airdrop_contract: Addr, minte
fn test_instantiate() {
let mut app = custom_mock_app();
let minter_address = Addr::unchecked("contract1");
let name_discount_wl_address = Addr::unchecked(MOCK_NAME_DISCOUNT_WL_ADDR_STR);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need some new unit tests that test the additional functionality, such as can only do the claim after name is registered correct?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. Updating them currently.

@jhernandezb jhernandezb marked this pull request as ready for review April 3, 2024 17:09
@jhernandezb jhernandezb merged commit 4744ccb into humanalgorithm/dydx-main-branch-v3.x Apr 3, 2024
14 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants