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

game sc tests #31

Merged
merged 5 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading