Skip to content

Commit

Permalink
Merge branch 'main' of github.com:rsksmart/builder-incentives-sc into…
Browse files Browse the repository at this point in the history
… main
  • Loading branch information
jmendiola222 committed Dec 4, 2024
2 parents 8d19959 + bc2be32 commit 1aecc6f
Show file tree
Hide file tree
Showing 67 changed files with 17,259 additions and 327 deletions.
23 changes: 23 additions & 0 deletions .env.30
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Required
export DEPLOYMENT_CONTEXT="mainnet"
export RPC_URL="https://public-node.rsk.co"
export NO_DD=true
export GAS_PRICE=66000000

# RIF Token
export REWARD_TOKEN_ADDRESS="0x2acc95758f8b5f583470ba265eb685a8f45fc9d5"
# STRIF Token
export STAKING_TOKEN_ADDRESS="0x5db91e24bd32059584bbdb831a901f1199f3d459"
# Governor configured in https://github.com/RootstockCollective/dao-frontend/blob/develop/.env.mainnet
export GOVERNOR_ADDRESS="0x71ac6ff904a17f50f2c07b693376ccc1c92627f0"

export KYC_APPROVER_ADDRESS="0x4736535f8c9a2571d18410133fc0d3dde3ae44ce"
export FOUNDATION_TREASURY_ADDRESS="0x267a6073637408b6A1d34d685ff5720A0CbCbD9d"
export UPGRADER_ADDRESS="0x3e4a679e27c2ff3381d1140d41eefb83c4a9d1db"

export REWARD_PERCENTAGE_COOLDOWN=604800 # 7 days
export CYCLE_DURATION=1209600 # 14 days
export DISTRIBUTION_DURATION=3600 # 1 hour
export CYCLE_START_OFFSET=0

export CHAIN_ID=30
26 changes: 17 additions & 9 deletions .env.31.qa
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
# Required
# FOR QA, we deployed the contracts with the distribution window set to 10 minutes
export DEPLOYMENT_CONTEXT="testnet_qa"
export RPC_URL="https://public-node.testnet.rsk.co"
export REWARD_TOKEN_ADDRESS="0x19F64674D8A5B4E652319F5e239eFd3bc969A1fE"

# QA-controlled address
export GOVERNOR_ADDRESS="0x5e3edE6781F811cb3fe03F9A687Bd7FFF8Dc19e7"
export KYC_APPROVER_ADDRESS="0xF4695CFF1E7dD0201b71a8A4F01D0450f89cC46C"
# QA-controlled address
export FOUNDATION_TREASURY_ADDRESS="0x21Fd219C937F7501d867CE660c3Bf605c7Fa629e"
# QA-controlled address
export KYC_APPROVER_ADDRESS="0x5e3edE6781F811cb3fe03F9A687Bd7FFF8Dc19e7"

export REWARD_TOKEN_ADDRESS="0x19F64674D8A5B4E652319F5e239eFd3bc969A1fE"
export STAKING_TOKEN_ADDRESS="0xC4b091d97AD25ceA5922f09fe80711B7ACBbb16f"
export REWARD_PERCENTAGE_COOLDOWN=300 # 5 minutes
export CYCLE_DURATION=1260 # 21 minutes
export CYCLE_START_OFFSET=0

export NO_DD=true
export GAS_PRICE=66000000

export STAKING_TOKEN_ADDRESS="0x14f6504A7ca4e574868cf8b49e85187d3Da9FA71"
export FOUNDATION_TREASURY_ADDRESS="0x14f6504A7ca4e574868cf8b49e85187d3Da9FA74"
export UPGRADER_ADDRESS="0x14f6504A7ca4e574868cf8b49e85187d3Da9FA74"
export REWARD_PERCENTAGE_COOLDOWN=1209600 #2 weeks
export CYCLE_DURATION=604800 #1 weeks
export DISTRIBUTION_DURATION=3600 #1 hour
export CYCLE_START_OFFSET=0
export UPGRADER_ADDRESS="0x5e3edE6781F811cb3fe03F9A687Bd7FFF8Dc19e7"
export DISTRIBUTION_DURATION=120 #10 mins


export CHAIN_ID=31
20 changes: 13 additions & 7 deletions .env.31.qa.dapp
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
# Required
# FOR QA, we deployed the contracts with the distribution window set to 10 minutes
export DEPLOYMENT_CONTEXT="testnet_qa_dapp"
export RPC_URL="https://public-node.testnet.rsk.co"
## RIF Token
export REWARD_TOKEN_ADDRESS="0x19F64674D8A5B4E652319F5e239eFd3bc969A1fE"
## Governor configured in the dapp QA env
## Governor from the DAO dev env
export GOVERNOR_ADDRESS="0xB1A39B8f57A55d1429324EEb1564122806eb297F"
## QA
# QA-controlled address
export FOUNDATION_TREASURY_ADDRESS="0x21Fd219C937F7501d867CE660c3Bf605c7Fa629e"
# QA-controlled address
export KYC_APPROVER_ADDRESS="0x5e3edE6781F811cb3fe03F9A687Bd7FFF8Dc19e7"
export REWARD_PERCENTAGE_COOLDOWN=1209600 #2 weeks
export CYCLE_DURATION=604800 #1 weeks

export REWARD_TOKEN_ADDRESS="0x19F64674D8A5B4E652319F5e239eFd3bc969A1fE"
export STAKING_TOKEN_ADDRESS="0xC4b091d97AD25ceA5922f09fe80711B7ACBbb16f"
export UPGRADER_ADDRESS="0x5e3edE6781F811cb3fe03F9A687Bd7FFF8Dc19e7"
export REWARD_PERCENTAGE_COOLDOWN=120 # 5 minutes
export CYCLE_DURATION=240 # 21 minutes
export CYCLE_START_OFFSET=0
export DISTRIBUTION_DURATION=3600 #1 hour
export DISTRIBUTION_DURATION=120 #10 mins
export NO_DD=true
export GAS_PRICE=66000000

export CHAIN_ID=31
4 changes: 3 additions & 1 deletion .solhint.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"bim/private-vars-leading-underscore-lib": "error",
"bim/func-return-param-name-trailing-underscore": "error",
"func-name-mixedcase": "off",
"foundry-test-functions": ["warn", ["setUp"]]
"foundry-test-functions": ["warn", ["setUp"]],
"no-empty-blocks": "off",
"one-contract-per-file": "off"
}
}
41 changes: 29 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ The following tools are required to be installed:
- [jq](https://jqlang.github.io/jq/download/) - Again, this is packaged to a variety of OSs, but if you don't have it
follow the link to install it for your system

> [!IMPORTANT] Please make sure to install foundry using the branch `f625d0fa7c51e65b4bf1e8f7931cd1c6e2e285e9`. By using
> [!IMPORTANT]
> Please make sure to install foundry using the branch `f625d0fa7c51e65b4bf1e8f7931cd1c6e2e285e9`. By using
> the latest version we experienced the following error on RSKj:
> `... deserialization error: missing field ``effectiveGasPrice`` ...`
Expand All @@ -59,7 +60,8 @@ cd collective-rewards-sc
bun install # install Solhint, Prettier, Hardhat and other Node.js deps
```

> [!WARNING] `.env.<chain_id>` could be public, don't put your private key or mnemonic there. Use `.env` for that.
> [!WARNING]
> `.env.<chain_id>` could be public, don't put your private key or mnemonic there. Use `.env` for that.
```sh
cp .env.private.example .env
Expand All @@ -81,10 +83,23 @@ direnv allow

upon which you'll be asked to present the chain id of the network you wish to use. This will be written in a file called
`.chain_id`. Alternatively, you can create this file yourself (content of which is only the chain id number itself)
before calling `direnv allow`. This will subsequently create environment variables (will unload after exiting the
directory; for more info see [direnv docs](https://direnv.net)) specified for given network inside the `.env.<chain_id>`
file. If such file does not exist you will be asked to create one for your network. This can be done by copying/moving
the `.env.example` file and changing the example vars to match your desired network. For example:
before calling `direnv allow`. This could be particularly useful when wishing to load configs for and to deploy to
multiple networks.

```sh
echo "31" > .chain_id && direnv allow
```

Or non-persistently (deleted upon reboot) with:

```sh
echo "31" > $(mktemp .chain_id) && direnv allow
```

This will subsequently create environment variables (will unload after exiting the directory; for more info see
[direnv docs](https://direnv.net)) specified for given network inside the `.env.<chain_id>` file. If such file does not
exist you will be asked to create one for your network. This can be done by copying/moving the `.env.example` file and
changing the example vars to match your desired network. For example:

```sh
mv .env.example .env.42
Expand All @@ -111,7 +126,7 @@ export DEPLOYER_ADDRESS="0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826"
export RPC_KEY="someRandomJWTToken" # if any
```

after changing these, the shell should remind you to re-run `direnv allow`, again. Do it even if it doesn't.
Then re-run `direnv allow` to load the new env vars.

If for development purposes you'd like to avoid using the deterministic deployer (CREATE2), so that your node doesn't
need to be restarted every time you want to redeploy, you can use `NO_DD=true` environment variable to deploy using
Expand Down Expand Up @@ -359,23 +374,25 @@ Generate coverage report:

### Reward token

TODO:
The reward token for the collective incentives program is `RIF`.

### Staking token

TODO:
The staking token is `stRIF`, where the token balance represents the backing power a backer has to vote for builders.

### Governor

TODO:
The Governor represents the DAO’s governance mechanism and is in charge of the community approval and de-whitelisting of
builders.

### KYC Approver

TODO:
The RoostockCollective Foundation requires builders to got through a KYC process and is in charge of submitting said
approval as well as revoking it if necessary.

### Foundation treasury

TODO:
The RoostockCollective Foundation is in charge of holding and distributing the rewards from the program.

## Acknowledgment

Expand Down
Loading

0 comments on commit 1aecc6f

Please sign in to comment.