Skip to content

Resolve deficiencies in documentation #274

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

Merged
merged 2 commits into from
May 15, 2025
Merged
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
23 changes: 12 additions & 11 deletions script/staking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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`.



## 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`.
Expand Down
Loading