Skip to content

Commit

Permalink
Refactor staking contract to use DivRem for calculating amount of vot…
Browse files Browse the repository at this point in the history
…ing tokens
  • Loading branch information
tensojka committed Jun 17, 2024
1 parent 13891b2 commit 06820fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/staking.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ mod staking {
};
floating_token.transfer_from(caller, get_contract_address(), amount.into());

let amount_voting_token = (amount * conversion_rate.into()) / 100;
let (amount_voting_token, _) = DivRem::div_rem((amount * conversion_rate.into()), 100);
let free_id = self.get_free_stake_id(caller);

self
Expand Down

0 comments on commit 06820fe

Please sign in to comment.