From 7f7547eeae3a6aa83cb325444a42eb23094a6857 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Tue, 13 May 2025 15:56:13 +1000 Subject: [PATCH 1/2] Resolve deficiencies in documentation --- script/staking/README.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/script/staking/README.md b/script/staking/README.md index c0549d42..0904a572 100644 --- a/script/staking/README.md +++ b/script/staking/README.md @@ -11,34 +11,35 @@ The following variables must be specified for all scripts. They can be supplied * `HARDWARE_WALLET`: Set to `ledger` for a Ledger hardware wallet, `trezor` for a Trezor hardware wallet, and not set when using a private key. See [Forge's documentation](https://book.getfoundry.sh/reference/forge/forge-script#wallet-options---hardware-wallet) for more information on hardware wallet configuration. * `HD_PATH`: Hierarchical Deterministic path. Must be set if using a Ledger or Trezor hardware wallet. Should be of the form: `HD_PATH="m/44'/60'/0'/0/0"`. * PRIVATE_KEY: A private key must be specified if HARDWARE_WALLET is not specified. The value should not be prefixed with `0x`. +* `DISTRIBUTE_ADMIN`: Initial account that will be authorised to upgrade the StakeHolderERC20 contract. Specify 0x0000000000000000000000000000000000000000 to have no account with distribute administrator access. +* `STAKEHOLDER_TYPE`: The stake holder configuration can be an ERC20 token or native IMX which is stored as wrapped IMX. For the ERC20 token variant, `STAKEHOLDER_TYPE` must be `ERC20`. For native IMX, `STAKEHOLDER_TYPE` must be `WIMX`. +* `ERC20_STAKING_TOKEN`: Address of ERC20 token to be used for staking. For use by ERC20 deployment script, which is used when `STAKEHOLDER_TYPE`=`ERC20`. +* `WIMX_TOKEN`: Address of WIMX token contract. For use by the WIMX deployment scirpt, which is used when `STAKEHOLDER_TYPE`=`WIMX`. + + ## Simple Deployment -To deploy the `StakeHolderERC20.sol` contract with a `ERC1967Proxy.sol`, use the `deploySimple.sh` script. +To deploy the `StakeHolderERC20.sol` or the `StakeHolderWIMX.sol` contract with a `ERC1967Proxy.sol`, use the `deploySimple.sh` script. -The following variables must be specified via the environment or a `.env` file for the `deploySimple.sh` script: +In addition to the common variables described above, the following variables must be specified via the environment or a `.env` file for the `deploySimple.sh` script: -* `DEPLOYER_ADDRESS`: Address that corresponds to the hardware wallet or private key. This account is used to deploy the `StakeHolderERC20` and the `ERC1967Proxy` contracts. +* `DEPLOYER_ADDRESS`: Address that corresponds to the hardware wallet or private key. This account is used to deploy the `StakeHolderERC20` or `StakeHolderWIMX` and the `ERC1967Proxy` contracts. * `ROLE_ADMIN`: Account that will be the initial role administrator. Accounts with the role administrator access can manage which accounts have `UPGRADE_ADMIN` and `DISTRIBUTED_ADMIN` access. Specify 0x0000000000000000000000000000000000000000 to have no account with role administrator access. * `UPGRADE_ADMIN`: Initial account that will be authorised to upgrade the StakeHolderERC20 contract. Specify 0x0000000000000000000000000000000000000000 to have no account with upgrade administrator access. -* `DISTRIBUTE_ADMIN`: Initial account that will be authorised to upgrade the StakeHolderERC20 contract. Specify 0x0000000000000000000000000000000000000000 to have no account with distribute administrator access. -* `ERC20_STAKING_TOKEN`: Address of ERC20 token to be used for staking. For use by ERC20 deployment script. -* `WIMX_TOKEN`: Address of WIMX token contract. For use by the WIMX deployment scirpt. ## Complex Deployment -To deploy the `StakeHolderERC20.sol` contract with a `ERC1967Proxy.sol` and a `TimelockController` using an `OwnableCreate3Deployer`, use the `deployComplex.sh` script. If you do not have access to an `OwnableCreate3Deployer` contract, use the `deployDeployer.sh` script to deploy this contract first. +To deploy the `StakeHolderERC20.sol` or the `StakeHolderWIMX.sol` contract with a `ERC1967Proxy.sol` and a `TimelockController` using an `OwnableCreate3Deployer`, use the `deployComplex.sh` script. If you do not have access to an `OwnableCreate3Deployer` contract, use the `deployDeployer.sh` script to deploy this contract first. -The following variables must be specified via the environment or a `.env` file for the `deployDeployer.sh` script: +In addition to the common variables described above, the following variables must be specified via the environment or a `.env` file for the `deployDeployer.sh` script: * `DEPLOYER_ADDRESS`: Address that corresponds to the hardware wallet of private key. This account is used to deploy the `OwnableCreate3Deployer` contract. -The following variables must be specified via the environment or a `.env` file for the `deployComplex.sh` script: +In addition to the common variables described above, the following variables must be specified via the environment or a `.env` file for the `deployComplex.sh` script: * `DEPLOYER_ADDRESS`: Address that corresponds to the hardware wallet or private key. This account is used to deploy the contracts via the `OwnableCreate3Deployer` contract. * `OWNABLE_CREATE3_FACTORY_ADDRESS`: Address of the `OwnableCreate3Deployer` contract. -* `DISTRIBUTE_ADMIN`: Initial account that will be authorised to upgrade the StakeHolderERC20 contract. Specify 0x0000000000000000000000000000000000000000 to have no account with distribute administrator access. -* `ERC20_STAKING_TOKEN`: Address of ERC20 token to be used for staking. * `TIMELOCK_DELAY_SECONDS`: Time in seconds between proposing actions and executing them. * `TIMELOCK_PROPOSER_ADMIN`: Address of account that can propose actions. Multiple proposers can be specified by modifying `StakeHolderScript.t.sol`. * `TIMELOCK_EXECUTOR_ADMIN`: Address of account that can execute actions. Multiple executors can be specified by modifying `StakeHolderScript.t.sol`. From 133856c459eceef1ae5f1bf629bb1497aca5ea1b Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Tue, 13 May 2025 16:01:26 +1000 Subject: [PATCH 2/2] Minor fixes to documentation --- script/staking/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/staking/README.md b/script/staking/README.md index 0904a572..f47dfa31 100644 --- a/script/staking/README.md +++ b/script/staking/README.md @@ -11,8 +11,8 @@ The following variables must be specified for all scripts. They can be supplied * `HARDWARE_WALLET`: Set to `ledger` for a Ledger hardware wallet, `trezor` for a Trezor hardware wallet, and not set when using a private key. See [Forge's documentation](https://book.getfoundry.sh/reference/forge/forge-script#wallet-options---hardware-wallet) for more information on hardware wallet configuration. * `HD_PATH`: Hierarchical Deterministic path. Must be set if using a Ledger or Trezor hardware wallet. Should be of the form: `HD_PATH="m/44'/60'/0'/0/0"`. * PRIVATE_KEY: A private key must be specified if HARDWARE_WALLET is not specified. The value should not be prefixed with `0x`. -* `DISTRIBUTE_ADMIN`: Initial account that will be authorised to upgrade the StakeHolderERC20 contract. Specify 0x0000000000000000000000000000000000000000 to have no account with distribute administrator access. -* `STAKEHOLDER_TYPE`: The stake holder configuration can be an ERC20 token or native IMX which is stored as wrapped IMX. For the ERC20 token variant, `STAKEHOLDER_TYPE` must be `ERC20`. For native IMX, `STAKEHOLDER_TYPE` must be `WIMX`. +* `DISTRIBUTE_ADMIN`: Initial account that will be authorised to distribute token to stakers. Specify 0x0000000000000000000000000000000000000000 to have no account with distribute administrator access. +* `STAKEHOLDER_TYPE`: The stake holder configuration can allow for an ERC20 token or native IMX to be staked. For the ERC20 token variant, `STAKEHOLDER_TYPE` must be `ERC20`. For native IMX, `STAKEHOLDER_TYPE` must be `WIMX`. * `ERC20_STAKING_TOKEN`: Address of ERC20 token to be used for staking. For use by ERC20 deployment script, which is used when `STAKEHOLDER_TYPE`=`ERC20`. * `WIMX_TOKEN`: Address of WIMX token contract. For use by the WIMX deployment scirpt, which is used when `STAKEHOLDER_TYPE`=`WIMX`.