Make TransparentUpgradeableProxy deploy its ProxyAdmin and optimize proxy interfaces (#4382)

Co-authored-by: Francisco <fg@frang.io>
Co-authored-by: Eric Lau <ericglau@outlook.com>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
Ernesto García
2023-07-13 16:25:22 -06:00
committed by GitHub
parent 9cf873ea14
commit 121be5dd09
27 changed files with 521 additions and 356 deletions

View File

@ -1,10 +1,10 @@
const { constants, expectEvent, expectRevert } = require('@openzeppelin/test-helpers');
const { expect } = require('chai');
const RLP = require('rlp');
const Enums = require('../../helpers/enums');
const { GovernorHelper, proposalStatesToBitMap } = require('../../helpers/governance');
const { expectRevertCustomError } = require('../../helpers/customError');
const { computeCreateAddress } = require('../../helpers/create');
const { shouldSupportInterfaces } = require('../../utils/introspection/SupportsInterface.behavior');
@ -14,15 +14,6 @@ const CallReceiver = artifacts.require('CallReceiverMock');
const ERC721 = artifacts.require('$ERC721');
const ERC1155 = artifacts.require('$ERC1155');
function makeContractAddress(creator, nonce) {
return web3.utils.toChecksumAddress(
web3.utils
.sha3(RLP.encode([creator, nonce]))
.slice(12)
.substring(14),
);
}
const TOKENS = [
{ Token: artifacts.require('$ERC20Votes'), mode: 'blocknumber' },
{ Token: artifacts.require('$ERC20VotesTimestampMock'), mode: 'timestamp' },
@ -49,7 +40,7 @@ contract('GovernorTimelockCompound', function (accounts) {
// Need to predict governance address to set it as timelock admin with a delayed transfer
const nonce = await web3.eth.getTransactionCount(deployer);
const predictGovernor = makeContractAddress(deployer, nonce + 1);
const predictGovernor = computeCreateAddress(deployer, nonce + 1);
this.timelock = await Timelock.new(predictGovernor, 2 * 86400);
this.mock = await Governor.new(