Skip to content

Commit

Permalink
Merge pull request #673 from public-awesome/jhernadnezb/dydx-airdrop-…
Browse files Browse the repository at this point in the history
…updates

dydx airdrop updates
  • Loading branch information
jhernandezb authored Mar 27, 2024
2 parents 613978f + 06bfc80 commit 5f1ed3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 4 additions & 5 deletions contracts/whitelists/whitelist-flex/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const CONTRACT_NAME: &str = "crates.io:sg-whitelist-flex";
const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");

// contract governance params
pub const MAX_MEMBERS: u32 = 5000;
pub const MAX_MEMBERS: u32 = 25_000;
pub const PRICE_PER_1000_MEMBERS: u128 = 100_000_000;
pub const MIN_MINT_PRICE: u128 = 0;

Expand Down Expand Up @@ -233,11 +233,10 @@ pub fn execute_add_members(
});
}
let addr = deps.api.addr_validate(&add.address)?;
if WHITELIST.has(deps.storage, addr.clone()) {
return Err(ContractError::DuplicateMember(addr.to_string()));
if !WHITELIST.has(deps.storage, addr.clone()) {
WHITELIST.save(deps.storage, addr, &add.mint_count)?;
config.num_members += 1;
}
WHITELIST.save(deps.storage, addr, &add.mint_count)?;
config.num_members += 1;
}

CONFIG.save(deps.storage, &config)?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ pub fn instantiate(
fn update_whitelist(deps: &mut DepsMut, msg: InstantiateMsg) -> Result<u64, ContractError> {
let mut count = 0u64;
for member in msg.members.into_iter() {
WHITELIST.save(deps.storage, &member.address, &member.mint_count)?;
let address_lower = member.address.clone().to_ascii_lowercase();
WHITELIST.save(deps.storage, &address_lower, &member.mint_count)?;
count += 1;
}
Ok(count)
Expand Down

0 comments on commit 5f1ed3e

Please sign in to comment.