Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: added deployment description and related links #25

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ functionality of [autonolas-registries](https://github.com/valory-xyz/autonolas-

### Prerequisites
- This repository follows the standard [`Hardhat`](https://hardhat.org/tutorial/) development process.
- The code is written on Solidity `0.8.21`.
- The code is written starting from Solidity `0.8.21`.
- The standard versions of Node.js along with Yarn are required to proceed further (confirmed to work with Yarn `1.22.19` and npx/npm `10.1.0` and node `v18.17.0`).

### Install the dependencies
Expand Down Expand Up @@ -55,8 +55,8 @@ Those include:
- running tests

## Deployment
The list of contract addresses for gnosis mainnet and a staking program configuration can be found here:
[contracts](https://github.com/valory-xyz/autonolas-staking-programmes/blob/main/scripts/deployment/globals_gnosis_mainnet.json).
The list of contract addresses for different networks and corresponding staking program configurations can be found in JSON files here:
[contracts](https://github.com/valory-xyz/autonolas-staking-programmes/blob/main/scripts/deployment).

The deployment of contracts to the test- and main-net is split into step-by-step series of scripts for more control and checkpoint convenience.
The description of deployment procedure can be found here: [deployment](https://github.com/valory-xyz/autonolas-staking-programmes/blob/main/scripts/deployment).
Expand All @@ -67,6 +67,10 @@ Each folder there contains contracts compiled with the solidity version before t
### Audits
The audit is provided as development matures. The latest audit report can be found here: [audits](https://github.com/valory-xyz/autonolas-staking-programmes/blob/main/audits).

### Related UI to facilitate staking contract creation
- Create staking proxy instance on [Launch](https://launch.olas.network/);
- Vote for staking contracts on [Govern](https://govern.olas.network/).


## Acknowledgements
The staking programmes contracts were inspired and based on the following sources:
Expand Down
13 changes: 11 additions & 2 deletions scripts/deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,17 @@ Parameters of the `globals.json` file:
- `useLedger`: a flag whether to use the hardware wallet (`true`) or proceed with the seed-phrase accounts (`false`);
- `derivationPath`: a string with the derivation path;
- `providerName`: a network type (see `hardhat.config.js` for the network configurations);
- `agentMechAddress`: an agent mech address:
- `networkURL`: a network RPC URL;
- `agentMechAddress`: an agent mech address;
- `livenessRatio`: number of service multisig transactions per second (with 18 decimals) that are used to measure the service
liveness (activity). In other words, it's the minimum number of transactions the service multisig needs to perform in order
to pass the liveness check. To check this `rewardsPerSecond* livenessPeriod/1e18` should approximate the number of txs required per livenessPeriod.
Assuming the number of required tx-s per day is 10, the liveness ratio can be checked by means of [this formula](https://www.wolframalpha.com/input?i=%28115740740740740+*+60+*+60+*+24%29+%2F+10%5E18).
Assuming the number of required tx-s per day is 10, the liveness ratio can be checked by means of [this formula](https://www.wolframalpha.com/input?i=%28115740740740740+*+60+*+60+*+24%29+%2F+10%5E18);
- `mechActivityCheckerAddress`: a mech activity checker contract address that is currently deployed using `agentMechAddress`
and `livenessRatio` values;
- `stakingTokenAddress`: a staking token implementation address all the instances are created with when deploying a proxy staking contract;
- `stakingFactoryAddress`: a staking proxy factory that creates each proxy staking contract;
- `stakingParams`: a set of staking contract parameters used to initiate each staking proxy contract. See [here](https://github.com/valory-xyz/autonolas-registries/blob/main/docs/StakingSmartContracts.pdf) for more details.

The script file name identifies the number of deployment steps taken from / to the number in the file name. For example:
- `deploy_01_mech_activity_checker.js` will complete step 1.
Expand All @@ -40,6 +46,9 @@ To run the script, use the following command:
`npx hardhat run scripts/deployment/script_name --network network_type`,
where `script_name` is a script name, i.e. `deploy_01_mech_activity_checker.js`, `network_type` is a network type corresponding to the `hardhat.config.js` network configuration.

Note: consider creating mech activity checker contract customized for specific needs, if the default one does not serve
the purpose for staking. Then, deploy staking proxy instances [here](https://launch.olas.network/).

## Validity checks and contract verification
Each script controls the obtained values by checking them against the expected ones. Also, each script has a contract verification procedure.
If a contract is deployed with arguments, these arguments are taken from the corresponding `verify_number_and_name` file, where `number_and_name` corresponds to the deployment script number and name.
Loading