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

added docs and small owner fix #32

Merged
merged 5 commits into from
Oct 10, 2023
Merged

added docs and small owner fix #32

merged 5 commits into from
Oct 10, 2023

Conversation

mihaicalinluca
Copy link
Contributor

No description provided.

@github-actions
Copy link

github-actions bot commented Oct 9, 2023

Contract comparison - from 38ce1b3 to 03c6823

Path                                                                                             size                  has-allocator                     has-format
mx-contracts-rs/contracts
- adder/adder.wasm 685 No No
- bonding-curve-contract/bonding-curve-contract.wasm 15606 No No
- check-pause/check-pause.wasm 1227 No No
- crowdfunding-esdt/crowdfunding-esdt.wasm 3612 No No
- crypto-bubbles/crypto-bubbles.wasm 2364 No No
- crypto-zombies/crypto-zombies.wasm 11131 No No
- digital-cash/digital-cash.wasm 7370 No No
- empty/empty.wasm 232 No No
- esdt-transfer-with-fee/esdt-transfer-with-fee.wasm 9094 No No
- factorial/factorial.wasm 567 No No
- fractional-nfts/fractional-nfts.wasm 8712 No No
- liquid-locking/liquid-locking.wasm 10239 No No
- lottery-esdt/lottery-esdt.wasm 11385 No No
- multisig
- - multisig.wasm 15306 No No
- - multisig-full.wasm 17310 No No
- - multisig-view.wasm 7699 No No
- mvx-game-sc/mvx-game-sc.wasm 10170 ➡️ 10176 🔴 No No
- mystery-box/mystery-box.wasm 13804 No No
- nft-escrow/nft-escrow.wasm 7327 No No
- nft-minter/nft-minter.wasm 10210 No No
- nft-storage-prepay/nft-storage-prepay.wasm 2293 No No
- paymaster/paymaster.wasm 7045 No No
- ping-pong-egld/ping-pong-egld.wasm 6696 No No
- price-aggregator/multiversx-price-aggregator-sc.wasm 20328 No No
- proxy-pause/proxy-pause.wasm 5753 No No
- rewards-distribution/rewards-distribution.wasm 11259 No No
- seed-nft-minter/seed-nft-minter.wasm 15343 No No
- token-release/token-release.wasm 8466 No No
- wegld-swap/multiversx-wegld-swap-sc.wasm 4382 No No
mx-contracts-rs/contracts/crypto-kitties
- kitty-auction/kitty-auction.wasm 11132 No No
- kitty-genetic-alg/kitty-genetic-alg.wasm 3584 No No
- kitty-ownership/kitty-ownership.wasm 14005 No No
mx-contracts-rs/contracts/order-book
- factory/order-book-factory.wasm 4995 No No
- pair/order-book-pair.wasm 16426 No No


The game is considered `invalid` until the `minimum number of players` have joined the game and if the `waiting time` has passed, no more players can join.

The SC does not have any logic for calculating the winner, so it expects input from the owner with the winnes' addresses and the percentage (*100) of the total reward (sum of wagers) won by each.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it expects input from the owner with the winners' addresses

**The game**:
- If the game is `invalid`, the `wager` amount will be returned to the players that have joined the game and the `game starting fee` will be returned to the creator
- If the game is `valid`, but no winners are sent by the owner, such in the case of a tie/draw, the contract will send back the `wager` amount paid by every player who joined
- If the game is `valid` and winners are sent by the owner, the SC will send the reward to the winners as explained by the owner
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rephrase a little, as the owner does not explain anything.
Something like
If the game is valid and the winners were provided, the SC will send the rewards to them, based on the input of the owner.


## Endpoints
### createGame
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better formated if you write the programming language, so add rust after the first ```, like so:

...

- If the game is `valid`, but no winners are sent by the owner, such in the case of a tie/draw, the contract will send back the `wager` amount paid by every player who joined
- If the game is `valid` and winners are sent by the owner, the SC will send the reward to the winners as explained by the owner
- If the game is `valid`, but no winners are provided, such in the case of a tie/draw, the contract will send back the `wager` amount paid by every player who joined
- If the game is `valid` and winners are provided, the SC will send the reward to the them, based on the input of the owner.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

send the rewards to them

@mihaicalinluca mihaicalinluca merged commit ff7a9e7 into main Oct 10, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants