Skip to content

Commit

Permalink
code optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
evilboyajay committed May 8, 2023
1 parent fc0bf1b commit 2964158
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions sources/candymachine.move
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ module candymachine::candymachine{
initialize_and_create_public_minter(&resource_signer_from_cap,candy_data,receiver_addr,candymachine);
mint_data.total_apt=mint_data.total_apt+candy_data.public_sale_mint_price;
};
assert!(candy_data.paused == false, EPAUSED);
assert!(candy_data.paused = false, EPAUSED);
assert!(candy_data.minted != candy_data.total_supply, ESOLD_OUT);
let remaining = candy_data.total_supply - candy_data.minted;
let random_index = pseudo_random(receiver_addr,remaining);
Expand Down Expand Up @@ -301,7 +301,7 @@ module candymachine::candymachine{
candy_data.royalty_points_numerator = royalty_points_numerator
};
};
if (public_sale_mint_price>0){
if (presale_mint_price>0){
candy_data.presale_mint_price = presale_mint_price
};
if (public_sale_mint_price>0){
Expand Down Expand Up @@ -410,10 +410,6 @@ module candymachine::candymachine{
assert!(remaining>0,999);

let random = from_bcs::to_u64(data) % remaining + 1;
if (random == 0 )
{
random = 1;
};
random
}

Expand Down

0 comments on commit 2964158

Please sign in to comment.