Skip to content

Commit

Permalink
Merge pull request #2 from GuiGou12358/main
Browse files Browse the repository at this point in the history
Improvements
  • Loading branch information
GuiGou12358 authored May 4, 2024
2 parents a979bee + db8ed8e commit f55a857
Show file tree
Hide file tree
Showing 10 changed files with 411 additions and 379 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@ A new `CheckNumber` request is sent to the message queue. This message is waitin
Next, the phat contract sends the winners (or an empty list if there is no winner) and the smart contract save them on the blockchain.
A new lottery can start. Each lottery is identified by an identifier: `raffle_id`.

More information to build the ink! smart contract and run integration tests [here](./ink/README.md).

## Phat contract

The phat contract is an offchain rollup in charge to proceed the messages sent by the ink! smart contract:
- when a `DrawNumbers` request is sent by the smart contract, the phat contract uses the `pink_extension::vrf` to randomly provide the winning numbers.
- when a `CheckWinners` request is sent by the smart contract, the phat contract reads the SubQuery indexer to check the winners and send them to ink! smart contract.
You can find more information about the communication between ink! smart contract and phat contract [here](https://github.com/Phala-Network/phat-offchain-rollup/).
You can find more information about the communication between ink! smart contract and phat contract [here](https://github.com/Phala-Network/phat-offchain-rollup/).

More information to build the phat contract and run unit tests [here](./phat/contracts/lotto_draw/README.md).
4 changes: 2 additions & 2 deletions ink/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ink/artifacts/lotto_contract.contract

Large diffs are not rendered by default.

Loading

0 comments on commit f55a857

Please sign in to comment.