Skip to content

Commit

Permalink
Merge pull request #31 from multiversx/game-sc-tests
Browse files Browse the repository at this point in the history
game sc tests
  • Loading branch information
mihaicalinluca authored Oct 9, 2023
2 parents 428c8db + d1d9f14 commit 38ce1b3
Show file tree
Hide file tree
Showing 2 changed files with 445 additions and 25 deletions.
4 changes: 3 additions & 1 deletion contracts/mvx-game-sc/src/owner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ use crate::types::Status;
multiversx_sc::imports!();
multiversx_sc::derive_imports!();

const DENOM: u64 = 10_000u64;

#[multiversx_sc::module]
pub trait OwnerModule: crate::private::PrivateModule + crate::storage::StorageModule {
//u64 is percentage * 100
Expand Down Expand Up @@ -35,7 +37,7 @@ pub trait OwnerModule: crate::private::PrivateModule + crate::storage::StorageMo

for (winner, percentage) in val.into_iter() {
let reward_per_winner =
&BigUint::from(percentage) * &total_wager / &BigUint::from(100u64);
&BigUint::from(percentage) * &total_wager / &BigUint::from(DENOM);
self.send()
.direct(&winner, &token_id, 0u64, &reward_per_winner);
}
Expand Down
Loading

0 comments on commit 38ce1b3

Please sign in to comment.