Skip to content

Commit

Permalink
Merge pull request #3 from GuiGou12358/main
Browse files Browse the repository at this point in the history
Fix readme
  • Loading branch information
GuiGou12358 committed Oct 16, 2023
2 parents 8473741 + eef4a03 commit 2ae3ec6
Showing 1 changed file with 25 additions and 31 deletions.
56 changes: 25 additions & 31 deletions ink/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,85 +8,79 @@ Structure of the project:
|-- contracts/
| |-- dapps_staking_developer/
| |-- lib.rs
| |-- lucky_oracle/
| |-- lib.rs
| |-- lucky_raffle/
| |-- lib.rs
| |-- random_generator/
| |-- lib.rs
| |-- reward_manager/
| |-- lib.rs
|-- traits/
| |-- reward
| |-- psp22_reward.rs
| |-- oracle.rs
| |-- raffle.rs
| |-- random_generators.rs
|-- logics/
| |-- helpers/
| |-- helper.rs
| |-- impls/
| |-- traits/
| |-- participant_filter
| |-- filter_latest_winner.rs
| |-- reward
| |-- psp22_reward.rs
| |-- oracle.rs
| |-- participant_manager.rs
| |-- raffle.rs
| |-- random.rs
| |-- random_generators.rs
| |-- tests/
| |-- participant_manager.rs
| |-- psp22_reward.rs
| |-- raffle.rs
| |-- random_generators.rs
|-- tests/
| |-- oracle.rs
| |-- psp22_reward.rs
| |-- raffle.rs
</pre>

## Smart contract 'dAppStaking Developer'

This smart contract will be registrered as developer in the dAppStaking module and will receive rewards from dAppStaking.
This smart contract will be registered as developer in the dAppStaking module and will receive rewards from dAppStaking.
The smart contract 'Raffle' will be whitelisted to be able to withdraw these rewards.

### Build the contract ###
```bash
cd contracts/dapps_staking_developer
cargo +nightly contract build
cargo contract build
```

## Smart contract 'lucky Oracle'
## Smart contract 'reward Manager'

This smart contract will act as an Oracle to provide the following data:
- list of participants who stake/vote for this dApp in dAppStaking module
- rewards received from dAppStaking (developer rewards)
This smart contract will manage rewards to distribute to the lucky addresses

### Build the contract ###
```bash
cd contracts/lucky_oracle
cargo +nightly contract build
cd contracts/reward_manager
cargo contract build
```

## Smart contract 'reward Manager'
## Smart contract 'random_generator'

This smart contract will manage rewards to distribute to the lucky addresses
This smart contract will act as an Oracle to provide the pseudo random number

### Build the contract ###
```bash
cd contracts/reward_manager
cargo +nightly contract build
cd contracts/random_generator
cargo contract build
```


## Smart contract 'lucky Raffle'

This smart contract will :
- read the data from the oracle
- randomly select address(es) in the list of participants
- transfer the fund from 'dAppStacking developer' to 'reward Manager' contracts
- set the lucky address(es) in the 'reward Manager' contract

### Build the contract ###
```bash
cd contracts/lucky_raffle
cargo +nightly contract build
cargo contract build
```


## Runs the tests

```bash
cargo +nightly test
cargo test
```


Expand Down

0 comments on commit 2ae3ec6

Please sign in to comment.