This smart contract is registered as developer in the dAppStaking
pallet and receives the rewards from dAppStaking.
The raffle_consumer
contract is whitelisted to be able to withdraw these rewards and then transfer them into the reward_manager
contract.
cd contracts/dapps_staking_developer
cargo contract build
This smart contract manages the rewards that the lucky addresses can claim.
Only the raffle_consumer
contract is granted to provide the list of winners.
cd contracts/reward_manager
cargo contract build
This smart contract :
- consumes the output coming from the
raffle
phat contract that manages the raffle, - transfers funds from
dapps_staking_developer
contract toreward_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.
cd contracts/raffle_consumer
cargo contract build
Before you can run the test, you have to install a Substrate node with pallet-contracts. By default, e2e tests require that you install substrate-contracts-node. You do not need to run it in the background since the node is started for each test independently. To install the latest version:
cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git
If you want to run any other node with pallet-contracts you need to change CONTRACTS_NODE environment variable:
export CONTRACTS_NODE="YOUR_CONTRACTS_NODE_PATH"
And finally execute the following command to start e2e tests execution.
cd integration_tests
cargo test --features e2e-tests