Skip to content

Commit

Permalink
Merge pull request #10 from GuiGou12358/main
Browse files Browse the repository at this point in the history
V2.0.0
  • Loading branch information
GuiGou12358 committed Apr 9, 2024
2 parents bb10730 + faa089a commit beac16b
Show file tree
Hide file tree
Showing 22 changed files with 779 additions and 711 deletions.
13 changes: 5 additions & 8 deletions ink/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# Lucky Ink! Smart Contracts

Smart contracts to manage the rewards received by the developer from dAppStaking.
Based on the configuration, a percentage of the rewards will be distributed randomly to 1,2,3, ... lucky participant(s).

## Smart contract `dapps_staking_developer`

This smart contract is registered as developer in the `dAppStaking` pallet and receives the rewards from dAppStaking.
The smart contract `raffle_consumer` is whitelisted to be able to withdraw these rewards and then transfer them into the `reward_manager` contract.
The `raffle_consumer` contract is whitelisted to be able to withdraw these rewards and then transfer them into the `reward_manager` contract.

### Build the contract

Expand All @@ -30,8 +27,8 @@ cargo contract build
## Smart contract `raffle_consumer`

This smart contract :
- consumes the data coming from the `raffle` phat contract that manages the raffle,
- transfers the fund from `dapps_staking_developer` contract to `reward_manager` contract,
- consumes the output coming from the `raffle` phat contract that manages the raffle,
- transfers funds from `dapps_staking_developer` contract to `reward_manager` contract,
- provide the lucky address(es) to `reward_manager` contract.

Only the `raffle` phat contract is granted to provide the output of the raffle.
Expand Down Expand Up @@ -60,6 +57,6 @@ export CONTRACTS_NODE="YOUR_CONTRACTS_NODE_PATH"
And finally execute the following command to start e2e tests execution.

```bash
cd contracts/raffle_consumer
cargo contract build
cd integration_tests
cargo test --features e2e-tests
```
1 change: 0 additions & 1 deletion ink/artifacts/raffle_consumer.contract

This file was deleted.

Binary file removed ink/artifacts/raffle_consumer.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions ink/artifacts/raffle_consumer/raffle_consumer.contract

Large diffs are not rendered by default.

Loading

0 comments on commit beac16b

Please sign in to comment.