|
| 1 | +import hre, { ethers, artifacts } from 'hardhat'; |
| 2 | +import { expect } from 'chai'; |
| 3 | +import { |
| 4 | + DeployUpgradeFunc, |
| 5 | + NamedAddresses, |
| 6 | + SetupUpgradeFunc, |
| 7 | + TeardownUpgradeFunc, |
| 8 | + ValidateUpgradeFunc |
| 9 | +} from '@custom-types/types'; |
| 10 | +import { Core } from '@custom-types/contracts'; |
| 11 | + |
| 12 | +/* |
| 13 | +
|
| 14 | +TC Proposal: Register Balance Metadata and grant POD_METADATA_ROLES |
| 15 | +
|
| 16 | +*/ |
| 17 | + |
| 18 | +const fipNumber = 'register_pod_metadata'; |
| 19 | + |
| 20 | +// Do any deployments |
| 21 | +// This should exclusively include new contract deployments |
| 22 | +const deploy: DeployUpgradeFunc = async (deployAddress: string, addresses: NamedAddresses, logging: boolean) => { |
| 23 | + console.log(`No deploy actions for fip${fipNumber}`); |
| 24 | + return { |
| 25 | + // put returned contract objects here |
| 26 | + }; |
| 27 | +}; |
| 28 | + |
| 29 | +// Do any setup necessary for running the test. |
| 30 | +// This could include setting up Hardhat to impersonate accounts, |
| 31 | +// ensuring contracts have a specific state, etc. |
| 32 | +const setup: SetupUpgradeFunc = async (addresses, oldContracts, contracts, logging) => { |
| 33 | + console.log(`No actions to complete in setup for fip${fipNumber}`); |
| 34 | +}; |
| 35 | + |
| 36 | +// Tears down any changes made in setup() that need to be |
| 37 | +// cleaned up before doing any validation checks. |
| 38 | +const teardown: TeardownUpgradeFunc = async (addresses, oldContracts, contracts, logging) => { |
| 39 | + console.log(`No actions to complete in teardown for fip${fipNumber}`); |
| 40 | +}; |
| 41 | + |
| 42 | +// Run any validations required on the fip using mocha or console logging |
| 43 | +// IE check balances, check state of contracts, etc. |
| 44 | +const validate: ValidateUpgradeFunc = async (addresses, oldContracts, contracts, logging) => { |
| 45 | + const core = contracts.core; |
| 46 | + const podMetadataRole = ethers.utils.id('POD_METADATA_REGISTER_ROLE'); |
| 47 | + |
| 48 | + const deployer1 = '0x5346b4ff3e924508d33d93f352d11e392a7a9d3b'; // Caleb |
| 49 | + const deployer2 = '0x64c4Bffb220818F0f2ee6DAe7A2F17D92b359c5d'; // Tom |
| 50 | + const deployer3 = '0xE2388f22cf5e328C197D6530663809cc0408a510'; // Joey |
| 51 | + const deployer4 = '0xcE96fE7Eb7186E9F894DE7703B4DF8ea60E2dD77'; // Erwan |
| 52 | + |
| 53 | + expect(await core.hasRole(podMetadataRole, deployer1)); |
| 54 | + expect(await core.hasRole(podMetadataRole, deployer2)); |
| 55 | + expect(await core.hasRole(podMetadataRole, deployer3)); |
| 56 | + expect(await core.hasRole(podMetadataRole, deployer4)); |
| 57 | +}; |
| 58 | + |
| 59 | +export { deploy, setup, teardown, validate }; |
0 commit comments