Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grant devs metadata registration role #853

Merged
merged 11 commits into from
Jun 1, 2022
2 changes: 1 addition & 1 deletion block.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14885000
14885000
59 changes: 59 additions & 0 deletions proposals/dao/register_proposal.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import hre, { ethers, artifacts } from 'hardhat';
import { expect } from 'chai';
import {
DeployUpgradeFunc,
NamedAddresses,
SetupUpgradeFunc,
TeardownUpgradeFunc,
ValidateUpgradeFunc
} from '@custom-types/types';
import { Core } from '@custom-types/contracts';

/*

TC Proposal: Register Balance Metadata and grant POD_METADATA_ROLES

*/

const fipNumber = 'register_pod_metadata';

// Do any deployments
// This should exclusively include new contract deployments
const deploy: DeployUpgradeFunc = async (deployAddress: string, addresses: NamedAddresses, logging: boolean) => {
console.log(`No deploy actions for fip${fipNumber}`);
return {
// put returned contract objects here
};
};

// Do any setup necessary for running the test.
// This could include setting up Hardhat to impersonate accounts,
// ensuring contracts have a specific state, etc.
const setup: SetupUpgradeFunc = async (addresses, oldContracts, contracts, logging) => {
console.log(`No actions to complete in setup for fip${fipNumber}`);
};

// Tears down any changes made in setup() that need to be
// cleaned up before doing any validation checks.
const teardown: TeardownUpgradeFunc = async (addresses, oldContracts, contracts, logging) => {
console.log(`No actions to complete in teardown for fip${fipNumber}`);
};

// Run any validations required on the fip using mocha or console logging
// IE check balances, check state of contracts, etc.
const validate: ValidateUpgradeFunc = async (addresses, oldContracts, contracts, logging) => {
const core = contracts.core;
const podMetadataRole = ethers.utils.id('POD_METADATA_REGISTER_ROLE');

const deployer1 = '0x5346b4ff3e924508d33d93f352d11e392a7a9d3b'; // Caleb
const deployer2 = '0x64c4Bffb220818F0f2ee6DAe7A2F17D92b359c5d'; // Tom
const deployer3 = '0xE2388f22cf5e328C197D6530663809cc0408a510'; // Joey
const deployer4 = '0xcE96fE7Eb7186E9F894DE7703B4DF8ea60E2dD77'; // Erwan

expect(await core.hasRole(podMetadataRole, deployer1));
expect(await core.hasRole(podMetadataRole, deployer2));
expect(await core.hasRole(podMetadataRole, deployer3));
expect(await core.hasRole(podMetadataRole, deployer4));
};

export { deploy, setup, teardown, validate };
52 changes: 52 additions & 0 deletions proposals/description/register_proposal.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { ProposalDescription } from '@custom-types/types';

const register_proposal: ProposalDescription = {
title: 'Register TC Proposal and grant pod metadata roles',
commands: [
{
target: 'core',
values: '0',
method: 'grantRole(bytes32,address)',
arguments: [
'0xf62a46a499242191aaab61084d4912c2c0a8c48e3d70edfb5a9be2bc9e92622f', // POD_METADATA_REGISTER_ROLE
'0x64c4Bffb220818F0f2ee6DAe7A2F17D92b359c5d'
],
description: 'Grant Tribe dev, Tom, POD_METADATA_REGISTER_ROLE to register proposal metadata'
},
{
target: 'core',
values: '0',
method: 'grantRole(bytes32,address)',
arguments: [
'0xf62a46a499242191aaab61084d4912c2c0a8c48e3d70edfb5a9be2bc9e92622f', // POD_METADATA_REGISTER_ROLE
'0x5346b4ff3e924508d33d93f352d11e392a7a9d3b'
],
description: 'Grant Tribe dev, Caleb, POD_METADATA_REGISTER_ROLE to register proposal metadata'
},
{
target: 'core',
values: '0',
method: 'grantRole(bytes32,address)',
arguments: [
'0xf62a46a499242191aaab61084d4912c2c0a8c48e3d70edfb5a9be2bc9e92622f', // POD_METADATA_REGISTER_ROLE
'0xcE96fE7Eb7186E9F894DE7703B4DF8ea60E2dD77'
],
description: 'Grant Tribe dev, Erwan, POD_METADATA_REGISTER_ROLE to register proposal metadata'
},
{
target: 'core',
values: '0',
method: 'grantRole(bytes32,address)',
arguments: [
'0xf62a46a499242191aaab61084d4912c2c0a8c48e3d70edfb5a9be2bc9e92622f', // POD_METADATA_REGISTER_ROLE
'0xE2388f22cf5e328C197D6530663809cc0408a510'
],
description: 'Grant Tribe dev, Joey, POD_METADATA_REGISTER_ROLE to register proposal metadata'
}
],
description: `
Grant Tribe engineers the POD_METADATA_REGISTER_ROLE so they are able to register pod proposal metadata
`
};

export default register_proposal;
20 changes: 20 additions & 0 deletions protocol-configuration/mainnetAddresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2120,6 +2120,26 @@ const MainnetAddresses: MainnetAddresses = {
artifactName: 'RoleBastion',
address: '0x8096314D9014EbB69Fc777ED3791DDE6FFbaFAed',
category: AddressCategory.Governance
},
tribeDev1Deployer: {
artifactName: 'unknown',
address: '0x64c4Bffb220818F0f2ee6DAe7A2F17D92b359c5d',
category: AddressCategory.External
},
tribeDev2Deployer: {
artifactName: 'unknown',
address: '0xcE96fE7Eb7186E9F894DE7703B4DF8ea60E2dD77',
category: AddressCategory.External
},
tribeDev3Deployer: {
artifactName: 'unknown',
address: '0xE2388f22cf5e328C197D6530663809cc0408a510',
category: AddressCategory.External
},
tribeDev4Deployer: {
artifactName: 'unknown',
address: '0x5346b4ff3e924508d33d93f352d11e392a7a9d3b',
category: AddressCategory.External
}
};

Expand Down
8 changes: 7 additions & 1 deletion protocol-configuration/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ export const permissions = {
METAGOVERNANCE_TOKEN_STAKING: ['feiDAOTimelock', 'opsOptimisticTimelock'],
METAGOVERNANCE_GAUGE_ADMIN: ['feiDAOTimelock', 'optimisticTimelock', 'tribalCouncilTimelock'],
ROLE_ADMIN: ['feiDAOTimelock', 'tribalCouncilTimelock'],
POD_METADATA_REGISTER_ROLE: ['tribalCouncilSafe'],
POD_METADATA_REGISTER_ROLE: [
'tribalCouncilSafe',
'tribeDev1Deployer',
'tribeDev2Deployer',
'tribeDev3Deployer',
'tribeDev4Deployer'
],
FEI_MINT_ADMIN: ['feiDAOTimelock', 'tribalCouncilTimelock'],
POD_VETO_ADMIN: ['nopeDAO'],
POD_ADMIN: ['tribalCouncilTimelock', 'podFactory'],
Expand Down
10 changes: 10 additions & 0 deletions test/integration/proposals_config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
import { ProposalCategory, ProposalsConfigMap } from '@custom-types/types';
import repay_fuse_bad_debt from '@proposals/description/repay_fuse_bad_debt';
import register_proposal from '@proposals/description/register_proposal';

const proposals: ProposalsConfigMap = {
register_proposal: {
deploy: false, // deploy flag for whether to run deploy action during e2e tests or use mainnet state
totalValue: 0, // amount of ETH to send to DAO execution
proposal: register_proposal, // full proposal file, imported from '@proposals/description/fip_xx.ts'
proposalId: '',
affectedContractSignoff: ['core'],
deprecatedContractSignoff: [],
category: ProposalCategory.TC
},
repay_fuse_bad_debt: {
deploy: false, // deploy flag for whether to run deploy action during e2e tests or use mainnet state
totalValue: 0, // amount of ETH to send to DAO execution
Expand Down
6 changes: 6 additions & 0 deletions test/integration/tests/psm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,9 @@ describe('e2e-peg-stability-module', function () {
await forceEth(raiWhale);
const raiWhaleSigner = await getImpersonatedSigner(raiWhale);
await rai.connect(raiWhaleSigner).transfer(raiPriceBoundPSM.address, redeemAmount);

// Set floor to something sufficiently low for tests to pass - RAI price on-chain fluctuates
await raiPriceBoundPSM.connect(impersonatedSigners[userAddress]).setOracleFloorBasisPoints(25000);
});

it('exchanges 1000 FEI for rai', async () => {
Expand Down Expand Up @@ -458,6 +461,9 @@ describe('e2e-peg-stability-module', function () {
await forceEth(raiAccount);
await rai.connect(raiSigner).transfer(userAddress, mintAmount);
await rai.connect(impersonatedSigners[userAddress]).approve(raiPriceBoundPSM.address, mintAmount * 2);

// Set floor to something sufficiently low for tests to pass - RAI price on-chain fluctuates
await raiPriceBoundPSM.connect(impersonatedSigners[userAddress]).setOracleFloorBasisPoints(2500);
});

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