diff --git a/.github/deployed-bytecode-consts.js b/.github/deployed-bytecode-consts.js deleted file mode 100644 index 32d74f6f1..000000000 --- a/.github/deployed-bytecode-consts.js +++ /dev/null @@ -1,20 +0,0 @@ -const APPS_TO_NAMES = new Map([ - ['lido', 'Lido'], - ['node-operators-registry', 'NodeOperatorsRegistry'], -]) - -const CONTRACTS_TO_NAMES = new Map([ - ['wstethContract', 'WstETH'], - ['executionLayerRewardsVault', 'LidoExecutionLayerRewardsVault'], - ['compositePostRebaseBeaconReceiver', 'CompositePostRebaseBeaconReceiver'], - ['burner', 'Burner'], - ['depositor', 'DepositSecurityModule'] -]) - -const IGNORE_METADATA_CONTRACTS = ['WstETH'] - -module.exports = { - APPS_TO_NAMES, - CONTRACTS_TO_NAMES, - IGNORE_METADATA_CONTRACTS -} diff --git a/.github/prepare-accounts-json.py b/.github/prepare-accounts-json.py deleted file mode 100755 index 4cf8ce381..000000000 --- a/.github/prepare-accounts-json.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/python3 -from pathlib import Path -import fileinput -import shutil -import os - -INFURA_PROJECT_ID = os.environ.get("INFURA_PROJECT_ID") -ETHERSCAN_API_KEY = os.environ.get("ETHERSCAN_API_KEY") - -ACCOUNTS_TMPL = Path("./accounts.sample.json") -ACCOUNTS = Path("./accounts.json") - - -def main(): - shutil.copyfile(ACCOUNTS_TMPL, ACCOUNTS) - with fileinput.FileInput(ACCOUNTS, inplace=True) as file: - for line in file: - updated_line = line.replace("INFURA_PROJECT_ID", INFURA_PROJECT_ID) - updated_line = updated_line.replace("ETHERSCAN_API_KEY", ETHERSCAN_API_KEY) - print(updated_line, end="") - - -if __name__ == "__main__": - main() diff --git a/.github/workflows/analyse.yml b/.github/workflows/analyse.yml index 153983807..5d50edb66 100644 --- a/.github/workflows/analyse.yml +++ b/.github/workflows/analyse.yml @@ -14,14 +14,14 @@ jobs: security-events: write steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false - name: Setup node.js version - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Get yarn cache directory path id: yarn-cache-dir-path @@ -57,7 +57,7 @@ jobs: run: > curl -sSL https://install.python-poetry.org | python - && poetry install --no-root - + - name: Remove foundry.toml run: rm -f foundry.toml diff --git a/.github/workflows/assert-bytecode.yml b/.github/workflows/assert-bytecode.yml index 5fbfed4ea..1f2680ea8 100644 --- a/.github/workflows/assert-bytecode.yml +++ b/.github/workflows/assert-bytecode.yml @@ -2,8 +2,7 @@ name: Verify deployed contracts' bytecode on: pull_request: - branches: - - 'master' + branches: [master] jobs: assert-bytecode: @@ -11,14 +10,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false - name: Setup node.js version - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Get yarn cache directory path id: yarn-cache-dir-path @@ -49,6 +48,9 @@ jobs: - name: Compile contracts run: yarn compile + - name: Write config for action-verify-bytecode + run: yarn extract-artifacts + - name: Verify bytecode uses: lidofinance/action-verify-bytecode@master with: @@ -64,5 +66,5 @@ jobs: cat _actual _expected | sort | uniq -u | tee _diff [ -s _diff ] && exit 1 || exit 0 env: - IGNORE_REGEX: test|lib|mock|interface|template|OrderedCallback|Pausable|Versioned|BeaconChainDepositor|PausableUntil + IGNORE_REGEX: test|lib|mock|interface|template|OrderedCallback|Pausable|Versioned|BeaconChainDepositor|PausableUntil|WithdrawalsManagerProxy|WithdrawalsManagerStub|ERC1967Proxy if: ${{ always() }} diff --git a/.github/workflows/fix-abi-pr.yml b/.github/workflows/fix-abi-pr.yml index 8cf1cd021..3aa0cc8bd 100644 --- a/.github/workflows/fix-abi-pr.yml +++ b/.github/workflows/fix-abi-pr.yml @@ -9,14 +9,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false - name: Setup node.js version - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Get yarn cache directory path id: yarn-cache-dir-path diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index ab42f861d..493cbd36b 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -8,14 +8,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false - name: Setup node.js version - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Get yarn cache directory path id: yarn-cache-dir-path @@ -57,14 +57,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false - name: Setup node.js version - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Get yarn cache directory path id: yarn-cache-dir-path diff --git a/.github/workflows/release-abis.yml b/.github/workflows/release-abis.yml index 9ab9a069b..7f8ffad83 100644 --- a/.github/workflows/release-abis.yml +++ b/.github/workflows/release-abis.yml @@ -14,14 +14,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false - name: Setup node.js version - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Get yarn cache directory path id: yarn-cache-dir-path diff --git a/.github/workflows/scratch-deploy-local.yml b/.github/workflows/scratch-deploy-local.yml new file mode 100644 index 000000000..af13cbf1e --- /dev/null +++ b/.github/workflows/scratch-deploy-local.yml @@ -0,0 +1,55 @@ +name: Scratch deploy on local clean anvil + +on: + pull_request: + branches: [master, develop] + +jobs: + do-scratch-deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + + - name: Start anvil in background + # For the port see port in scripts/scratch/dao-local-deploy.sh in RPC_URL env var + run: anvil -p 8555 --mnemonic "test test test test test test test test test test test junk" & + + - name: Setup node.js version + uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT + + - name: Cache yarn cache + id: cache-yarn-cache + uses: actions/cache@v3 + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: yarn-${{ hashFiles('**/yarn.lock') }} + + - name: Cache node_modules + id: cache-node-modules + uses: actions/cache@v3 + with: + path: '**/node_modules' + key: node_modules-${{ hashFiles('**/yarn.lock') }} + restore-keys: node_modules-${{ hashFiles('**/yarn.lock') }} + + - name: Install modules + run: yarn + if: | + steps.cache-yarn-cache.outputs.cache-hit != 'true' || + steps.cache-node-modules.outputs.cache-hit != 'true' + + - name: Run local deploy script + run: bash scripts/scratch/dao-local-deploy.sh diff --git a/.github/workflows/storage-layout-check.yml b/.github/workflows/storage-layout-check.yml index 41d545115..597aaf309 100644 --- a/.github/workflows/storage-layout-check.yml +++ b/.github/workflows/storage-layout-check.yml @@ -12,12 +12,12 @@ jobs: name: Assert storage layout steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup node.js version - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 16.x + node-version: 18.x cache: 'yarn' - name: Submodules @@ -32,3 +32,4 @@ jobs: mode: check src-folder: ./contracts ignore-folders: '{test_helpers,template,mocks}' + ignore-contracts: 'WithdrawalsManagerProxy|WithdrawalsManagerStub|ERC1967Proxy' diff --git a/.github/workflows/storage-layout-update.yml b/.github/workflows/storage-layout-update.yml index a8a4247ed..a08d2307b 100644 --- a/.github/workflows/storage-layout-update.yml +++ b/.github/workflows/storage-layout-update.yml @@ -9,12 +9,12 @@ jobs: name: Update storage layout steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup node.js version - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 16.x + node-version: 18.x cache: 'yarn' - name: Install yarn deps diff --git a/artifacts.json b/artifacts.json deleted file mode 100644 index 36c2e847a..000000000 --- a/artifacts.json +++ /dev/null @@ -1,176 +0,0 @@ -[ - { - "artifactPath": "artifacts/contracts/0.8.9/proxy/OssifiableProxy.sol/OssifiableProxy.json", - "sourcePath": "contracts/0.8.9/proxy/OssifiableProxy.sol", - "name": "OssifiableProxy", - "address": "0x852deD011285fe67063a08005c71a85690503Cee", - "txHash": "0x3def88f27741216b131de2861cf89af2ca2ac4242b384ee33dca8cc70c51c8dd" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/oracle/AccountingOracle.sol/AccountingOracle.json", - "sourcePath": "contracts/0.8.9/oracle/AccountingOracle.sol", - "name": "AccountingOracle", - "address": "0xF3c5E0A67f32CF1dc07a8817590efa102079a1aF", - "txHash": "0x3e27627d3ed236aff8901df187196e9682187dfd0d259c5d5811a6e923436083" - }, - { - "artifactPath": "artifacts/contracts/0.4.24/Lido.sol/Lido.json", - "sourcePath": "contracts/0.4.24/Lido.sol", - "name": "Lido", - "address": "0x17144556fd3424EDC8Fc8A4C940B2D04936d17eb", - "txHash": "0xb4b5e02643c9802fd0f7c73c4854c4f1b83497aca13f8297ba67207b71c4dcd9" - }, - { - "artifactPath": "artifacts/contracts/0.4.24/nos/NodeOperatorsRegistry.sol/NodeOperatorsRegistry.json", - "sourcePath": "contracts/0.4.24/nos/NodeOperatorsRegistry.sol", - "name": "NodeOperatorsRegistry", - "address": "0x8538930c385C0438A357d2c25CB3eAD95Ab6D8ed", - "txHash": "0xbec5b6ffb8fbc775a183e25cd285367993d7201752e1638a07abec8962bab750" - }, - { - "artifactPath": "artifacts/contracts/0.4.24/oracle/LegacyOracle.sol/LegacyOracle.json", - "sourcePath": "contracts/0.4.24/oracle/LegacyOracle.sol", - "name": "LegacyOracle", - "address": "0xa29b819654cE6224A222bb5f586920105E2D7E0E", - "txHash": "0xe666e3ce409bb4c18e1016af0b9ed3495b20361a69f2856bccb9e67599795b6f" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/Burner.sol/Burner.json", - "sourcePath": "contracts/0.8.9/Burner.sol", - "name": "Burner", - "address": "0xD15a672319Cf0352560eE76d9e89eAB0889046D3", - "txHash": "0xbebf5c85404a0d8e36b859046c984fdf6dd764b5d317feb7eb3525016005b1d9" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/DepositSecurityModule.sol/DepositSecurityModule.json", - "sourcePath": "contracts/0.8.9/DepositSecurityModule.sol", - "name": "DepositSecurityModule", - "address": "0xC77F8768774E1c9244BEed705C4354f2113CFc09", - "txHash": "0x21307a2321f167f99de11ccec86d7bdd8233481bbffa493e15c519ca8d662c4f" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/EIP712StETH.sol/EIP712StETH.json", - "sourcePath": "contracts/0.8.9/EIP712StETH.sol", - "name": "EIP712StETH", - "address": "0x8F73e4C2A6D852bb4ab2A45E6a9CF5715b3228B7", - "txHash": "0xecb5010620fb13b0e2bbc98b8a0c82de0d7385491452cd36cf303cd74216ed91" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/LidoExecutionLayerRewardsVault.sol/LidoExecutionLayerRewardsVault.json", - "sourcePath": "contracts/0.8.9/LidoExecutionLayerRewardsVault.sol", - "name": "LidoExecutionLayerRewardsVault", - "address": "0x388C818CA8B9251b393131C08a736A67ccB19297", - "txHash": "0xd72cf25e4a5fe3677b6f9b2ae13771e02ad66f8d2419f333bb8bde3147bd4294" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/oracle/HashConsensus.sol/HashConsensus.json", - "sourcePath": "contracts/0.8.9/oracle/HashConsensus.sol", - "name": "HashConsensus", - "address": "0xD624B08C83bAECF0807Dd2c6880C3154a5F0B288", - "txHash": "0xd74dcca9bacede9f332d70562f49808254061853937ffbbfc7397ab5d017041a" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/oracle/HashConsensus.sol/HashConsensus.json", - "sourcePath": "contracts/0.8.9/oracle/HashConsensus.sol", - "name": "HashConsensus", - "address": "0x7FaDB6358950c5fAA66Cb5EB8eE5147De3df355a", - "txHash": "0xed1ab73dd5458b5ec0b174508318d2f39a31029112af21f87d09106933bd3a9e" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/proxy/OssifiableProxy.sol/OssifiableProxy.json", - "sourcePath": "contracts/0.8.9/proxy/OssifiableProxy.sol", - "name": "OssifiableProxy", - "address": "0xC1d0b3DE6792Bf6b4b37EccdcC24e45978Cfd2Eb", - "txHash": "0x3a2910624533935cc8c21837b1705bcb159a760796930097016186be705cc455" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/LidoLocator.sol/LidoLocator.json", - "sourcePath": "contracts/0.8.9/LidoLocator.sol", - "name": "LidoLocator", - "address": "0x1D920cc5bACf7eE506a271a5259f2417CaDeCE1d", - "txHash": "0xf90012ef0a40e47c909ab3a5b3503ecee78f6a9be134d1349a742e500d37ae33" - }, - { - "artifactPath": "artifacts/contracts/0.4.24/template/LidoTemplate.sol/LidoTemplate.json", - "sourcePath": "contracts/0.4.24/template/LidoTemplate.sol", - "name": "LidoTemplate", - "address": "0x752350797CB92Ad3BF1295Faf904B27585e66BF5", - "txHash": "0xdcd4ebe028aa3663a1fe8bbc92ae8489045e29d2a6ef5284083d9be5c3fa5f19" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/OracleDaemonConfig.sol/OracleDaemonConfig.json", - "sourcePath": "contracts/0.8.9/OracleDaemonConfig.sol", - "name": "OracleDaemonConfig", - "address": "0xbf05A929c3D7885a6aeAd833a992dA6E5ac23b09", - "txHash": "0xa4f380b8806f5a504ef67fce62989e09be5a48bf114af63483c01c22f0c9a36f" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/sanity_checks/OracleReportSanityChecker.sol/OracleReportSanityChecker.json", - "sourcePath": "contracts/0.8.9/sanity_checks/OracleReportSanityChecker.sol", - "name": "OracleReportSanityChecker", - "address": "0x9305c1Dbfe22c12c66339184C0025d7006f0f1cC", - "txHash": "0x700c83996ad7deefda286044280ad86108dfef9c880909bd8e75a3746f7d631c" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/proxy/OssifiableProxy.sol/OssifiableProxy.json", - "sourcePath": "contracts/0.8.9/proxy/OssifiableProxy.sol", - "name": "OssifiableProxy", - "address": "0xFdDf38947aFB03C621C71b06C9C70bce73f12999", - "txHash": "0xb8620f04a8db6bb52cfd0978c6677a5f16011e03d4622e5d660ea6ba34c2b122" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/StakingRouter.sol/StakingRouter.json", - "sourcePath": "contracts/0.8.9/StakingRouter.sol", - "name": "StakingRouter", - "address": "0xD8784e748f59Ba711fB5643191Ec3fAdD50Fb6df", - "txHash": "0xd6d489f22203c835da6027ff0e532a01a08f36f0fda6c7c0a42e471ae3b3c461" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/proxy/OssifiableProxy.sol/OssifiableProxy.json", - "sourcePath": "contracts/0.8.9/proxy/OssifiableProxy.sol", - "name": "OssifiableProxy", - "address": "0x0De4Ea0184c2ad0BacA7183356Aea5B8d5Bf5c6e", - "txHash": "0xef3eea1523d2161c2f36ba61e327e3520231614c055b8a88c7f5928d18e423ea" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/oracle/ValidatorsExitBusOracle.sol/ValidatorsExitBusOracle.json", - "sourcePath": "contracts/0.8.9/oracle/ValidatorsExitBusOracle.sol", - "name": "ValidatorsExitBusOracle", - "address": "0xA89Ea51FddE660f67d1850e03C9c9862d33Bc42c", - "txHash": "0x5ab545276f78a72a432c3e971c96384973abfab6394e08cb077a006c25aef7a7" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/proxy/OssifiableProxy.sol/OssifiableProxy.json", - "sourcePath": "contracts/0.8.9/proxy/OssifiableProxy.sol", - "name": "OssifiableProxy", - "address": "0x889edC2eDab5f40e902b864aD4d7AdE8E412F9B1", - "txHash": "0x98c2170be034f750f5006cb69ea0aeeaf0858b11f6324ee53d582fa4dd49bc1a" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/WithdrawalQueueERC721.sol/WithdrawalQueueERC721.json", - "sourcePath": "contracts/0.8.9/WithdrawalQueueERC721.sol", - "name": "WithdrawalQueueERC721", - "address": "0xE42C659Dc09109566720EA8b2De186c2Be7D94D9", - "txHash": "0x6ab0151735c01acdef518421358d41a08752169bc383c57d57f5bfa135ac6eb1" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/WithdrawalVault.sol/WithdrawalVault.json", - "sourcePath": "contracts/0.8.9/WithdrawalVault.sol", - "name": "WithdrawalVault", - "address": "0xCC52f17756C04bBa7E377716d7062fC36D7f69Fd", - "txHash": "0xd9eb2eca684770e4d2b192709b6071875f75072a0ce794a582824ee907a704f3" - }, - { - "artifactPath": "artifacts/contracts/0.6.12/WstETH.sol/WstETH.json", - "sourcePath": "contracts/0.6.12/WstETH.sol", - "name": "WstETH", - "address": "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0", - "txHash": "0xaf2c1a501d2b290ef1e84ddcfc7beb3406f8ece2c46dee14e212e8233654ff05" - }, - { - "artifactPath": "artifacts/contracts/0.6.11/deposit_contract.sol/DepositContract.json", - "sourcePath": "contracts/0.6.11/deposit_contract.sol", - "name": "DepositContract", - "address": "0x00000000219ab540356cBB839Cbe05303d7705Fa" - } -] diff --git a/contracts/0.4.24/template/LidoTemplate.sol b/contracts/0.4.24/template/LidoTemplate.sol index a90fb784d..b589f04d8 100644 --- a/contracts/0.4.24/template/LidoTemplate.sol +++ b/contracts/0.4.24/template/LidoTemplate.sol @@ -612,6 +612,7 @@ contract LidoTemplate is IsContract { _createPermissionForVoting(acl, _state.operators, perms[i], voting); } acl.createPermission(_state.stakingRouter, _state.operators, _state.operators.STAKING_ROUTER_ROLE(), voting); + acl.createPermission(_state.agent, _state.operators, _state.operators.MANAGE_NODE_OPERATOR_ROLE(), voting); // Lido perms[0] = _state.lido.PAUSE_ROLE(); diff --git a/docs/scratch-deploy.md b/docs/scratch-deploy.md index f6cd2a5e6..2bed6b2ad 100644 --- a/docs/scratch-deploy.md +++ b/docs/scratch-deploy.md @@ -58,21 +58,20 @@ A brief description of what's going on under the hood in the deploy script. ## Local deployment Deploys the DAO to local (http://127.0.0.1:8545) dev node (anvil, hardhat, ganache). -The deployment is done from the default test account `0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266`. -The node must be configured with the default test accounts derived from the mnemonic `test test test test test test test test test test test junk`. +The deployment is done from the default test account `0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266` derived from the default mnemonic. +Thus the node must be configured with the default test accounts derived from the mnemonic `test test test test test test test test test test test junk`. 1. Run `yarn install` (get sure repo dependencies are installed) 2. Run the node on default port 8545 (for the commands, see subsections below) -3. Set test account private key `0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80` to `accounts.json` under `/eth/local` like `"local": [""]` (see `accounts.sample.json` for example) -4. Run the deploy script `bash scripts/scratch/dao-local-deploy.sh` from root repo directory -5. Check out the deploy artifacts in `deployed-local.json` +3. Run the deploy script `bash scripts/scratch/dao-local-deploy.sh` from root repo directory +4. Check out the deploy artifacts in `deployed-local.json` ### Anvil Run the node with the command: ```shell -anvil -p 8545 --auto-impersonate --gas-price 0 --base-fee 0 --chain-id 1337 --mnemonic "test test test test test test test test test test test junk" +anvil -p 8545 --mnemonic "test test test test test test test test test test test junk" ``` ### Hardhat node diff --git a/package.json b/package.json index d9f20e113..3716d0ebe 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "test:coverage": "yarn compile && hardhat coverage --testfiles test", "test:e2e": "yarn compile && ava -T 1000000 -v", "estimate-deposit-loop-gas": "yarn run test:unit ./estimate_deposit_loop_gas.js", - "compile": "hardhat compile && yarn extract-abi && yarn extract-artifacts", + "compile": "hardhat compile && yarn extract-abi", "clean": "hardhat clean", "userdoc": "hardhat userdoc", "extract-abi": "node ./scripts/extract-abi.js", diff --git a/scripts/extract-artifacts.js b/scripts/extract-artifacts.js index b00f9194c..bfdeb052f 100644 --- a/scripts/extract-artifacts.js +++ b/scripts/extract-artifacts.js @@ -6,7 +6,7 @@ const artifactsPath = path.resolve(__dirname, '..', artifactsFileName) const deployedFileName = 'deployed-mainnet.json' const deployedPath = path.resolve(__dirname, '..', deployedFileName) -const stateKeysToIgnore = ['dummyEmptyContract'] +const stateKeysToIgnore = ['dummyEmptyContract', 'lidoTemplate'] const additionalArtifacts = [ { "artifactPath": "artifacts/contracts/0.6.11/deposit_contract.sol/DepositContract.json", diff --git a/scripts/scratch/00-populate-deploy-artifact-from-env.js b/scripts/scratch/00-populate-deploy-artifact-from-env.js index 8c584541b..e029c76cb 100644 --- a/scripts/scratch/00-populate-deploy-artifact-from-env.js +++ b/scripts/scratch/00-populate-deploy-artifact-from-env.js @@ -17,6 +17,7 @@ async function saveDeployParameters({ web3, artifacts }) { GATE_SEAL_FACTORY, GENESIS_TIME, DEPOSIT_CONTRACT, + WITHDRAWAL_QUEUE_BASE_URI, }) const state = readNetworkState(network.name, netId) diff --git a/scripts/scratch/checks/scratch-acceptance-test.js b/scripts/scratch/checks/scratch-acceptance-test.js index f1b6c198c..1430c1a70 100644 --- a/scripts/scratch/checks/scratch-acceptance-test.js +++ b/scripts/scratch/checks/scratch-acceptance-test.js @@ -9,12 +9,8 @@ const { assert } = require('../../../test/helpers/assert') const REQUIRED_NET_STATE = [ - 'ensAddress', - 'lidoApmEnsName', - 'daoAragonId', 'vestingParams', 'daoInitialSettings', - 'lidoTemplate' ] const UNLIMITED = 1000000000 @@ -87,8 +83,8 @@ async function prepareProtocolForSubmitDepositReportWithdrawalFlow(protocol, sta await withdrawalQueue.resume({ from: agent.address }) await withdrawalQueue.renounceRole(await withdrawalQueue.RESUME_ROLE(), agent.address, { from: agent.address }) - await nodeOperatorsRegistry.addNodeOperator('1', ADDRESS_1, { from: voting.address }) - await nodeOperatorsRegistry.addNodeOperator('2', ADDRESS_2, { from: voting.address }) + await nodeOperatorsRegistry.addNodeOperator('1', ADDRESS_1, { from: agent.address }) + await nodeOperatorsRegistry.addNodeOperator('2', ADDRESS_2, { from: agent.address }) await nodeOperatorsRegistry.addSigningKeys(0, 1, pad('0x010203', 48), pad('0x01', 96), { from: voting.address }) await nodeOperatorsRegistry.addSigningKeys( diff --git a/scripts/scratch/dao-local-deploy.sh b/scripts/scratch/dao-local-deploy.sh index 03f6b7445..60aa80f38 100755 --- a/scripts/scratch/dao-local-deploy.sh +++ b/scripts/scratch/dao-local-deploy.sh @@ -4,7 +4,7 @@ set -o pipefail # export NETWORK=local -export RPC_URL="http://127.0.0.1:8545" +export RPC_URL=${RPC_URL:="http://127.0.0.1:8555"} # if defined use the value set to default otherwise # If GateSeal factory is zero, deploy no GateSeal instance. Otherwise use the factory to deploy an instance export GATE_SEAL_FACTORY=0x0000000000000000000000000000000000000000 @@ -19,3 +19,8 @@ export NETWORK_STATE_FILE="deployed-${NETWORK}.json" export NETWORK_STATE_DEFAULTS_FILE="deployed-testnet-defaults.json" bash scripts/scratch/dao-deploy.sh + +# # Need this to get sure the last transactions are mined +yarn hardhat --network $NETWORK run ./scripts/scratch/send-hardhat-mine.js --no-compile + +NETWORK_STATE_FILE=deployed-local.json HARDHAT_FORKING_URL="${RPC_URL}" yarn hardhat run --no-compile ./scripts/scratch/checks/scratch-acceptance-test.js --network hardhat \ No newline at end of file diff --git a/scripts/scratch/send-hardhat-mine.js b/scripts/scratch/send-hardhat-mine.js new file mode 100644 index 000000000..1f07f7950 --- /dev/null +++ b/scripts/scratch/send-hardhat-mine.js @@ -0,0 +1,10 @@ +const runOrWrapScript = require('../helpers/run-or-wrap-script') +const { log } = require('../helpers/log') + +async function main() { + // 0x01 is too little, 0x80 works, although less might be enough + await ethers.provider.send('hardhat_mine', ["0x80"]) + log.success(`Send "hardhat_mine"`) +} + +module.exports = runOrWrapScript(main, module)