99 ValidateUpgradeFunc
1010} from '@custom-types/types' ;
1111import { Contract } from 'ethers' ;
12+ import { validateArraysEqual } from '@test/helpers' ;
1213
1314/*
1415
@@ -26,9 +27,17 @@ const fipNumber = 'fip_82b';
2627// Do any deployments
2728// This should exclusively include new contract deployments
2829const deploy : DeployUpgradeFunc = async ( deployAddress : string , addresses : NamedAddresses , logging : boolean ) => {
29- console . log ( `No deploy actions for fip${ fipNumber } ` ) ;
30+ const deploySigner = ( await ethers . getSigners ( ) ) [ 0 ] ;
31+ const previousPCVGuardian = await ethers . getContractAt ( 'PCVGuardian' , addresses . pcvGuardian , deploySigner ) ;
32+ const safeAddresses = await previousPCVGuardian . getSafeAddresses ( ) ;
33+
34+ const pcvGuardianFactory = await ethers . getContractFactory ( 'PCVGuardian' ) ;
35+ const pcvGuardianNew = await pcvGuardianFactory . deploy ( addresses . core , safeAddresses ) ;
36+ logging && console . log ( 'PCVGuardian deployed to: ' , pcvGuardianNew . address ) ;
37+ logging && console . log ( 'PCVGuardian safeAddresses: ' , safeAddresses ) ;
38+
3039 return {
31- // put returned contract objects here
40+ pcvGuardianNew
3241 } ;
3342} ;
3443
@@ -48,7 +57,40 @@ const teardown: TeardownUpgradeFunc = async (addresses, oldContracts, contracts,
4857// Run any validations required on the fip using mocha or console logging
4958// IE check balances, check state of contracts, etc.
5059const validate : ValidateUpgradeFunc = async ( addresses , oldContracts , contracts , logging ) => {
51- console . log ( `No actions to complete in validate for fip${ fipNumber } ` ) ;
60+ // 1. Validate new PCVGuardian deployment and roles granted
61+ const core = contracts . core ;
62+ const newPCVGuardian = contracts . pcvGuardianNew ;
63+
64+ const safeAddresses = await newPCVGuardian . getSafeAddresses ( ) ;
65+ const expectedSafeAddresses = [
66+ '0xd51dba7a94e1adea403553a8235c302cebf41a3c' ,
67+ '0x4fcb1435fd42ce7ce7af3cb2e98289f79d2962b3' ,
68+ '0x98e5f5706897074a4664dd3a32eb80242d6e694b' ,
69+ '0x5b86887e171bae0c2c826e87e34df8d558c079b9' ,
70+ '0x2a188f9eb761f70ecea083ba6c2a40145078dfc2' ,
71+ '0xb0e731f036adfdec12da77c15aab0f90e8e45a0e' ,
72+ '0x24f663c69cd4b263cf5685a49013ff5f1c898d24' ,
73+ '0x5ae217de26f6ff5f481c6e10ec48b2cf2fc857c8' ,
74+ '0xe8633c49ace655eb4a8b720e6b12f09bd3a97812' ,
75+ '0xcd1ac0014e2ebd972f40f24df1694e6f528b2fd4' ,
76+ '0xc5bb8f0253776bec6ff450c2b40f092f7e7f5b57' ,
77+ '0xc4eac760c2c631ee0b064e39888b89158ff808b2' ,
78+ '0x2c47fef515d2c70f2427706999e158533f7cf090' ,
79+ '0x9aadffe00eae6d8e59bb4f7787c6b99388a6960d' ,
80+ '0xd2174d78637a40448112aa6b30f9b19e6cf9d1f9' ,
81+ '0x5dde9b4b14edf59cb23c1d4579b279846998205e'
82+ ] ;
83+ validateArraysEqual ( safeAddresses , expectedSafeAddresses ) ;
84+
85+ // New PCV Guardian roles - validate granted
86+ expect ( await core . hasRole ( ethers . utils . id ( 'GUARDIAN_ROLE' ) , newPCVGuardian . address ) ) . to . be . true ;
87+ expect ( await core . hasRole ( ethers . utils . id ( 'PCV_CONTROLLER_ROLE' ) , newPCVGuardian . address ) ) . to . be . true ;
88+
89+ // Old PCV Guardian roles - validate revoked
90+ expect ( await core . hasRole ( ethers . utils . id ( 'GUARDIAN_ROLE' ) , addresses . pcvGuardian ) ) . to . be . false ;
91+ expect ( await core . hasRole ( ethers . utils . id ( 'PCV_CONTROLLER_ROLE' ) , addresses . pcvGuardian ) ) . to . be . false ;
92+
93+ // 2. Validate TribalCouncil role transfers
5294 await validateTransferredRoleAdmins ( contracts . core ) ;
5395 await validateNewCouncilRoles ( contracts . core ) ;
5496 await validateContractAdmins ( contracts ) ;
@@ -76,6 +118,7 @@ const validateTransferredRoleAdmins = async (core: Contract) => {
76118 expect ( await core . getRoleAdmin ( ethers . utils . id ( 'METAGOVERNANCE_GAUGE_ADMIN' ) ) ) . to . be . equal ( ROLE_ADMIN ) ;
77119 expect ( await core . getRoleAdmin ( ethers . utils . id ( 'SWAP_ADMIN_ROLE' ) ) ) . to . be . equal ( ROLE_ADMIN ) ;
78120 expect ( await core . getRoleAdmin ( ethers . utils . id ( 'VOTIUM_ADMIN_ROLE' ) ) ) . to . be . equal ( ROLE_ADMIN ) ;
121+ expect ( await core . getRoleAdmin ( ethers . utils . id ( 'RATE_LIMITED_MINTER_ADMIN' ) ) ) . to . be . equal ( ROLE_ADMIN ) ;
79122} ;
80123
81124/// Validate that the expected new TribeRoles have been created
@@ -86,6 +129,8 @@ const validateNewCouncilRoles = async (core: Contract) => {
86129 expect ( await core . getRoleAdmin ( ethers . utils . id ( 'FEI_MINT_ADMIN' ) ) ) . to . be . equal ( ROLE_ADMIN ) ;
87130 expect ( await core . getRoleAdmin ( ethers . utils . id ( 'PCV_MINOR_PARAM_ROLE' ) ) ) . to . be . equal ( ROLE_ADMIN ) ;
88131 expect ( await core . getRoleAdmin ( ethers . utils . id ( 'PSM_ADMIN_ROLE' ) ) ) . to . be . equal ( ROLE_ADMIN ) ;
132+ expect ( await core . getRoleAdmin ( ethers . utils . id ( 'PCV_SAFE_MOVER_ROLE' ) ) ) . to . be . equal ( ROLE_ADMIN ) ;
133+ expect ( await core . getRoleAdmin ( ethers . utils . id ( 'PCV_GUARDIAN_ADMIN_ROLE' ) ) ) . to . be . equal ( ROLE_ADMIN ) ;
89134} ;
90135
91136/// Validate that the relevant contract admins have been set to their expected values
@@ -134,6 +179,7 @@ const validateTribalCouncilRoles = async (core: Contract, tribalCouncilTimelockA
134179 expect ( await core . hasRole ( ethers . utils . id ( 'PCV_GUARDIAN_ADMIN_ROLE' ) , tribalCouncilTimelockAddress ) ) . to . be . true ;
135180 expect ( await core . hasRole ( ethers . utils . id ( 'ORACLE_ADMIN_ROLE' ) , tribalCouncilTimelockAddress ) ) . to . be . true ;
136181 expect ( await core . hasRole ( ethers . utils . id ( 'PSM_ADMIN_ROLE' ) , tribalCouncilTimelockAddress ) ) . to . be . true ;
182+ expect ( await core . hasRole ( ethers . utils . id ( 'PCV_SAFE_MOVER_ROLE' ) , tribalCouncilTimelockAddress ) ) . to . be . true ;
137183} ;
138184
139185export { deploy , setup , teardown , validate } ;
0 commit comments