From 665916a0ae5ec2cfb3da43ddabb0af18bbd0a950 Mon Sep 17 00:00:00 2001 From: Alain Olivier Date: Mon, 26 Feb 2024 21:43:01 +0100 Subject: [PATCH] test(fork): remove EpochsManager upgrade from missingSteps() --- .openzeppelin/unknown-100.json | 213 ++++++++++++++++++++++++++++++++- test/fork/dao.test.js | 11 +- 2 files changed, 209 insertions(+), 15 deletions(-) diff --git a/.openzeppelin/unknown-100.json b/.openzeppelin/unknown-100.json index 23917f8..250c01d 100644 --- a/.openzeppelin/unknown-100.json +++ b/.openzeppelin/unknown-100.json @@ -36,11 +36,6 @@ "txHash": "0xced7cd7a7e735b894adcabdf8a79933df2b2fbcad616f8ad1bbeff855dddc66e", "kind": "uups" }, - { - "address": "0xFDD7d2f23F771F05C6CEbFc9f9bC2A771FAE302e", - "txHash": "0xaf06d7128a1e5de4212b876205eb6d6fe3054730e41415c74840b62b557a0cbe", - "kind": "uups" - }, { "address": "0x2ec44F9F31a55b52b3c1fF98647E38d63f829fb7", "kind": "uups" @@ -68,6 +63,10 @@ { "address": "0xdEE8ebE2b7152ECCd935fd67134BF1bad55302BC", "kind": "uups" + }, + { + "address": "0xFDD7d2f23F771F05C6CEbFc9f9bC2A771FAE302e", + "kind": "uups" } ], "impls": { @@ -5304,6 +5303,210 @@ }, "namespaces": {} } + }, + "0c726d335a8e72a5d5b99b4bdadce87a246834950a31f6b4acf896f4fc5ff9be": { + "address": "0x80E60ff08DA71B39E40C5089106650995891eb16", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:169" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol:111" + }, + { + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:40" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC165Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol:41" + }, + { + "label": "_roles", + "offset": 0, + "slot": "201", + "type": "t_mapping(t_bytes32,t_struct(RoleData)169_storage)", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:57" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:260" + }, + { + "label": "_roleMembers", + "offset": 0, + "slot": "251", + "type": "t_mapping(t_bytes32,t_struct(AddressSet)3819_storage)", + "contract": "AccessControlEnumerableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:17" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlEnumerableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:76" + }, + { + "label": "_epochDuration", + "offset": 0, + "slot": "301", + "type": "t_uint256", + "contract": "EpochsManager", + "src": "contracts/core/EpochsManager.sol:12" + }, + { + "label": "_startFirstEpochTimestamp", + "offset": 0, + "slot": "302", + "type": "t_uint256", + "contract": "EpochsManager", + "src": "contracts/core/EpochsManager.sol:13" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(AddressSet)3819_storage)": { + "label": "mapping(bytes32 => struct EnumerableSetUpgradeable.AddressSet)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(RoleData)169_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_uint256)": { + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32" + }, + "t_struct(AddressSet)3819_storage": { + "label": "struct EnumerableSetUpgradeable.AddressSet", + "members": [ + { + "label": "_inner", + "type": "t_struct(Set)3504_storage", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "64" + }, + "t_struct(RoleData)169_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_mapping(t_address,t_bool)", + "offset": 0, + "slot": "0" + }, + { + "label": "adminRole", + "type": "t_bytes32", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)3504_storage": { + "label": "struct EnumerableSetUpgradeable.Set", + "members": [ + { + "label": "_values", + "type": "t_array(t_bytes32)dyn_storage", + "offset": 0, + "slot": "0" + }, + { + "label": "_indexes", + "type": "t_mapping(t_bytes32,t_uint256)", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + } } } } diff --git a/test/fork/dao.test.js b/test/fork/dao.test.js index a234bee..6c51429 100644 --- a/test/fork/dao.test.js +++ b/test/fork/dao.test.js @@ -48,8 +48,7 @@ const { hardhatReset } = require('../utils/hardhat-reset') const { mintPToken, pegoutToken } = require('../utils/pnetwork') const { sendEth } = require('../utils/send-eth') -const { CHANGE_TOKEN_ROLE, CREATE_VOTES_ROLE, CREATE_PAYMENTS_ROLE, DEPOSIT_REWARD_ROLE, UPGRADE_ROLE } = - getAllRoles(ethers) +const { CHANGE_TOKEN_ROLE, CREATE_VOTES_ROLE, CREATE_PAYMENTS_ROLE, DEPOSIT_REWARD_ROLE } = getAllRoles(ethers) const USER_ADDRESS = '0xdDb5f4535123DAa5aE343c24006F4075aBAF5F7B' const ADDRESS_PLACEHOLDER = '0x0123456789012345678901234567890123456789' @@ -155,7 +154,6 @@ describe('Integration tests on Gnosis deployment', () => { ] const missingSteps = async () => { - await upgradeContracts() const MockPToken = await ethers.getContractFactory('MockPTokenERC20') pntOnGnosis = await MockPToken.deploy('Host Token (pToken)', 'HTKN', pntMinter.address, PNETWORK_NETWORK_IDS.GNOSIS) await stakingManager.connect(daoOwner).grantRole(CHANGE_TOKEN_ROLE, SAFE_ADDRESS) @@ -226,13 +224,6 @@ describe('Integration tests on Gnosis deployment', () => { 0 ]) } - const upgradeContracts = async () => { - await epochsManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) - - const currentEpoch = await epochsManager.currentEpoch() - await upgrades.upgradeProxy(epochsManager, EpochsManager) - expect(await await epochsManager.currentEpoch()).to.be.eq(currentEpoch) - } beforeEach(async () => { const rpc = config.networks.hardhat.forking.url