Skip to content

Commit a812153

Browse files
authored
Merge pull request #853 from fei-protocol/tc-metadata-roles
Grant devs metadata registration role
2 parents caca6f4 + 29196f0 commit a812153

File tree

7 files changed

+155
-2
lines changed

7 files changed

+155
-2
lines changed

block.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14885000
1+
14885000

proposals/dao/register_proposal.ts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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 };
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import { ProposalDescription } from '@custom-types/types';
2+
3+
const register_proposal: ProposalDescription = {
4+
title: 'Register TC Proposal and grant pod metadata roles',
5+
commands: [
6+
{
7+
target: 'core',
8+
values: '0',
9+
method: 'grantRole(bytes32,address)',
10+
arguments: [
11+
'0xf62a46a499242191aaab61084d4912c2c0a8c48e3d70edfb5a9be2bc9e92622f', // POD_METADATA_REGISTER_ROLE
12+
'0x64c4Bffb220818F0f2ee6DAe7A2F17D92b359c5d'
13+
],
14+
description: 'Grant Tribe dev, Tom, POD_METADATA_REGISTER_ROLE to register proposal metadata'
15+
},
16+
{
17+
target: 'core',
18+
values: '0',
19+
method: 'grantRole(bytes32,address)',
20+
arguments: [
21+
'0xf62a46a499242191aaab61084d4912c2c0a8c48e3d70edfb5a9be2bc9e92622f', // POD_METADATA_REGISTER_ROLE
22+
'0x5346b4ff3e924508d33d93f352d11e392a7a9d3b'
23+
],
24+
description: 'Grant Tribe dev, Caleb, POD_METADATA_REGISTER_ROLE to register proposal metadata'
25+
},
26+
{
27+
target: 'core',
28+
values: '0',
29+
method: 'grantRole(bytes32,address)',
30+
arguments: [
31+
'0xf62a46a499242191aaab61084d4912c2c0a8c48e3d70edfb5a9be2bc9e92622f', // POD_METADATA_REGISTER_ROLE
32+
'0xcE96fE7Eb7186E9F894DE7703B4DF8ea60E2dD77'
33+
],
34+
description: 'Grant Tribe dev, Erwan, POD_METADATA_REGISTER_ROLE to register proposal metadata'
35+
},
36+
{
37+
target: 'core',
38+
values: '0',
39+
method: 'grantRole(bytes32,address)',
40+
arguments: [
41+
'0xf62a46a499242191aaab61084d4912c2c0a8c48e3d70edfb5a9be2bc9e92622f', // POD_METADATA_REGISTER_ROLE
42+
'0xE2388f22cf5e328C197D6530663809cc0408a510'
43+
],
44+
description: 'Grant Tribe dev, Joey, POD_METADATA_REGISTER_ROLE to register proposal metadata'
45+
}
46+
],
47+
description: `
48+
Grant Tribe engineers the POD_METADATA_REGISTER_ROLE so they are able to register pod proposal metadata
49+
`
50+
};
51+
52+
export default register_proposal;

protocol-configuration/mainnetAddresses.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2120,6 +2120,26 @@ const MainnetAddresses: MainnetAddresses = {
21202120
artifactName: 'RoleBastion',
21212121
address: '0x8096314D9014EbB69Fc777ED3791DDE6FFbaFAed',
21222122
category: AddressCategory.Governance
2123+
},
2124+
tribeDev1Deployer: {
2125+
artifactName: 'unknown',
2126+
address: '0x64c4Bffb220818F0f2ee6DAe7A2F17D92b359c5d',
2127+
category: AddressCategory.External
2128+
},
2129+
tribeDev2Deployer: {
2130+
artifactName: 'unknown',
2131+
address: '0xcE96fE7Eb7186E9F894DE7703B4DF8ea60E2dD77',
2132+
category: AddressCategory.External
2133+
},
2134+
tribeDev3Deployer: {
2135+
artifactName: 'unknown',
2136+
address: '0xE2388f22cf5e328C197D6530663809cc0408a510',
2137+
category: AddressCategory.External
2138+
},
2139+
tribeDev4Deployer: {
2140+
artifactName: 'unknown',
2141+
address: '0x5346b4ff3e924508d33d93f352d11e392a7a9d3b',
2142+
category: AddressCategory.External
21232143
}
21242144
};
21252145

protocol-configuration/permissions.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ export const permissions = {
4545
METAGOVERNANCE_TOKEN_STAKING: ['feiDAOTimelock', 'opsOptimisticTimelock'],
4646
METAGOVERNANCE_GAUGE_ADMIN: ['feiDAOTimelock', 'optimisticTimelock', 'tribalCouncilTimelock'],
4747
ROLE_ADMIN: ['feiDAOTimelock', 'tribalCouncilTimelock'],
48-
POD_METADATA_REGISTER_ROLE: ['tribalCouncilSafe'],
48+
POD_METADATA_REGISTER_ROLE: [
49+
'tribalCouncilSafe',
50+
'tribeDev1Deployer',
51+
'tribeDev2Deployer',
52+
'tribeDev3Deployer',
53+
'tribeDev4Deployer'
54+
],
4955
FEI_MINT_ADMIN: ['feiDAOTimelock', 'tribalCouncilTimelock'],
5056
POD_VETO_ADMIN: ['nopeDAO'],
5157
POD_ADMIN: ['tribalCouncilTimelock', 'podFactory'],

test/integration/proposals_config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
import { ProposalCategory, ProposalsConfigMap } from '@custom-types/types';
22
import repay_fuse_bad_debt from '@proposals/description/repay_fuse_bad_debt';
3+
import register_proposal from '@proposals/description/register_proposal';
34

45
const proposals: ProposalsConfigMap = {
6+
register_proposal: {
7+
deploy: false, // deploy flag for whether to run deploy action during e2e tests or use mainnet state
8+
totalValue: 0, // amount of ETH to send to DAO execution
9+
proposal: register_proposal, // full proposal file, imported from '@proposals/description/fip_xx.ts'
10+
proposalId: '',
11+
affectedContractSignoff: ['core'],
12+
deprecatedContractSignoff: [],
13+
category: ProposalCategory.TC
14+
},
515
repay_fuse_bad_debt: {
616
deploy: false, // deploy flag for whether to run deploy action during e2e tests or use mainnet state
717
totalValue: 0, // amount of ETH to send to DAO execution

test/integration/tests/psm.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,9 @@ describe('e2e-peg-stability-module', function () {
407407
await forceEth(raiWhale);
408408
const raiWhaleSigner = await getImpersonatedSigner(raiWhale);
409409
await rai.connect(raiWhaleSigner).transfer(raiPriceBoundPSM.address, redeemAmount);
410+
411+
// Set floor to something sufficiently low for tests to pass - RAI price on-chain fluctuates
412+
await raiPriceBoundPSM.connect(impersonatedSigners[userAddress]).setOracleFloorBasisPoints(25000);
410413
});
411414

412415
it('exchanges 1000 FEI for rai', async () => {
@@ -458,6 +461,9 @@ describe('e2e-peg-stability-module', function () {
458461
await forceEth(raiAccount);
459462
await rai.connect(raiSigner).transfer(userAddress, mintAmount);
460463
await rai.connect(impersonatedSigners[userAddress]).approve(raiPriceBoundPSM.address, mintAmount * 2);
464+
465+
// Set floor to something sufficiently low for tests to pass - RAI price on-chain fluctuates
466+
await raiPriceBoundPSM.connect(impersonatedSigners[userAddress]).setOracleFloorBasisPoints(2500);
461467
});
462468

463469
it('cannot mint because the rai psm is paused', async () => {

0 commit comments

Comments
 (0)