Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mtabasco committed Aug 30, 2023
1 parent f419c87 commit d7b7634
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ OPERATOR_MAX_FEE_INCREASE=3
DECLARE_OPERATOR_FEE_PERIOD=259200 # 3 days
EXECUTE_OPERATOR_FEE_PERIOD=345600 # 4 days
VALIDATORS_PER_OPERATOR_LIMIT=500
SSVTOKEN_ADDRESS=
7 changes: 4 additions & 3 deletions docs/local-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@ Copy [.env.example](../.env.example) to `.env` and edit to suit.
- `GAS_PRICE` example 30000000000
- `GAS` example 8000000
- `ETHERSCAN_KEY` etherescan API key to verify deployed contracts
- `SSVTOKEN_ADDRESS` SSV Token contract address
- `SSVTOKEN_ADDRESS` SSV Token contract address to be used in custom networks. Keep it empty to deploy a mocked SSV token.
- `MINIMUM_BLOCKS_BEFORE_LIQUIDATION` a number of blocks before the cluster enters into a liquidatable state. Example: 214800 = 30 days
- `OPERATOR_MAX_FEE_INCREASE` the fee increase limit in percentage with this format: 100% = 10000, 10% = 1000 - using 10000 to represent 2 digit precision
- `DECLARE_OPERATOR_FEE_PERIOD` the period in which an operator can declare a fee change (seconds)
- `EXECUTE_OPERATOR_FEE_PERIOD` the period in which an operator fee change can be executed (seconds)
- `VALIDATORS_PER_OPERATOR_LIMIT` the number of validators an operator can manage
- `SSVNETWORK_PROXY_ADDRESS` SSVNetwork proxy address
- `SSVNETWORKVIEWS_PROXY_ADDRESS` SSVNetworkViews proxy address


#### Network configuration
In [hardhat.config.ts](../hardhat.config.ts) you can find specific configs for different networks, that are taken into account only when the `[NETWORK]_ETH_NODE_URL` parameter in `.env` file is set.
Expand All @@ -44,6 +43,8 @@ For more details about it and how to use MainNet forking you can find [here](htt
### Deployment
The inital deployment process involves the deployment of all main modules (SSVClusters, SSVOperators, SSVDAO and SSVViews), SSVNetwork and SSVNetworkViews contracts.

Note: The SSV token address used when deploying to live networks (goerli, mainnet) is set in the hardhat config file. To deploy the contracts to a custom network defined in the hardhat config file, leave `SSVTOKEN_ADDRESS` empty in the `.env` file. You can set a specific SSV token address for custom networks too, if needed.

To run the deployment, execute:
```sh
npx hardhat --network <network> deploy:all
Expand Down
9 changes: 4 additions & 5 deletions docs/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ Following Hardhat's way of working, you must specify the network against which y
### Deploy all contracts
Runs the deployment of the main SSVNetwork and SSVNetworkViews contracts, along with their associated modules:
```
npx hardhat --network goerli deploy:all
npx hardhat --network goerli_stage deploy:all
```

When deploying to live networks like Goerli or Mainnet, please double check the environment variables:
- SSV_TOKEN_ADDRESS
- MINIMUM_BLOCKS_BEFORE_LIQUIDATION
- MINIMUM_LIQUIDATION_COLLATERAL
- VALIDATORS_PER_OPERATOR_LIMIT
Expand Down Expand Up @@ -81,7 +80,7 @@ POSITIONAL ARGUMENTS:
params Function parameters
Example:
npx hardhat --network goerli upgrade:proxy --proxyAddress 0x1234... --contract SSVNetworkV2 --initFunction initializev2 --params param1 param2
npx hardhat --network goerli_stage upgrade:proxy --proxyAddress 0x1234... --contract SSVNetworkV2 --initFunction initializev2 --params param1 param2
```

### Update a module
Expand All @@ -101,7 +100,7 @@ OPTIONS:
Example:
Update 'SSVOperators' module contract in the SSVNetwork
npx hardhat --network goerli update:module --module SSVOperators --attach-module true --proxyAddress 0x1234...
npx hardhat --network goerli_stage update:module --module SSVOperators --attach-module true --proxyAddress 0x1234...
```

### Upgrade a library
Expand All @@ -126,7 +125,7 @@ OPTIONS:
--proxy-address Proxy address of SSVNetwork / SSVNetworkViews (default: null)
Example:
npx hardhat --network goerli upgrade:prepare --proxy-address 0x1234... --contract SSVNetworkViewsV2
npx hardhat --network goerli_stage upgrade:prepare --proxy-address 0x1234... --contract SSVNetworkViewsV2
```

The task will return the new implementation address. After that, you can run `upgradeTo` or `upgradeToAndCall` in SSVNetwork / SSVNetworkViews proxy address, providing it as a parameter.
Expand Down
2 changes: 1 addition & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const config: HardhatUserConfig = {
ganache: {
chainId: 1337,
url: "http://127.0.0.1:8585",
ssvToken: '' // deploy SSV mock token
ssvToken: process.env.SSVTOKEN_ADDRESS // if empty, deploy SSV mock token
} as SSVNetworkConfig,
hardhat: {
allowUnlimitedContractSize: true
Expand Down
4 changes: 2 additions & 2 deletions tasks/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ It uses the Hardhat Runtime Environment (HRE) to execute the deployment tasks an
it will be printed to the console, and the process will exit with a non-zero status code.
@example
// Deploy all contracts with the default deployer account
npx hardhat --network goerli deploy:all
npx hardhat --network goerli_stage deploy:all
@remarks
The deployer account used will be the first one returned by ethers.getSigners().
Therefore, it should be appropriately configured in your Hardhat network configuration.
Expand Down Expand Up @@ -50,7 +50,7 @@ The contract parameter specifies the name of the contract implementation to be d
it will be printed to the console, and the process will exit with a non-zero status code.
@example
// Deploy SSVNetwork implementation contract with the default deployer account
npx hardhat --network goerli deploy:main-impl --contract SSVNetwork
npx hardhat --network goerli_stage deploy:main-impl --contract SSVNetwork
@remarks
The deployer account used will be the first one returned by ethers.getSigners().
Therefore, it should be appropriately configured in your Hardhat network configuration.
Expand Down
2 changes: 1 addition & 1 deletion tasks/update-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The address of the SSVNetwork Proxy is expected to be set in the environment var
@param {string} proxyAddress - The proxy address of the SSVNetwork contract.
@example
// Update 'SSVOperators' module contract in the SSVNetwork
npx hardhat --network goerli update:module --module SSVOperators
npx hardhat --network goerli_stage update:module --module SSVOperators
@remarks
The deployer account used will be the first one returned by ethers.getSigners().
Therefore, it should be appropriately configured in your Hardhat network configuration.
Expand Down
4 changes: 2 additions & 2 deletions tasks/upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ If 'initFunction' is not provided, this parameter has no effect.
@returns {void} This function doesn't return anything. After successfully upgrading, it prints the new implementation address to the console.
@example
// Upgrade the SSVNetwork contract to a new version 'SSVNetworkV2', and call a function 'initializev2' with parameters after upgrade:
npx hardhat --network goerli upgrade:proxy --proxyAddress 0x1234... --contract SSVNetworkV2 --initFunction initializev2 --params param1 param2
npx hardhat --network goerli_stage upgrade:proxy --proxyAddress 0x1234... --contract SSVNetworkV2 --initFunction initializev2 --params param1 param2
*/
task("upgrade:proxy", "Upgrade SSVNetwork / SSVNetworkViews proxy via hardhat upgrades plugin")
.addParam("proxyAddress", "Proxy address of SSVNetwork / SSVNetworkViews", null, types.string)
Expand Down Expand Up @@ -56,7 +56,7 @@ The proxy address and contract name must be provided as parameters.
@param {string} contract - The name of the new implementation contract to deploy for the upgrade.
@example
// Prepare an upgrade for the SSVNetworkViews proxy contract with a new implementation contract named 'SSVNetworkViewsV2'
npx hardhat --network goerli upgrade:prepare --proxyAddress 0x1234... --contract SSVNetworkViewsV2
npx hardhat --network goerli_stage upgrade:prepare --proxyAddress 0x1234... --contract SSVNetworkViewsV2
@remarks
The deployer account used will be the first one returned by ethers.getSigners().
Therefore, it should be appropriately configured in your Hardhat network configuration.
Expand Down

0 comments on commit d7b7634

Please sign in to comment.