Skip to content

Commit

Permalink
chore: Deploy v0.9.1 (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xCardinalError authored Sep 12, 2024
1 parent 9e35317 commit cf64768
Show file tree
Hide file tree
Showing 9 changed files with 919 additions and 344 deletions.
2 changes: 1 addition & 1 deletion deploy/main/005_deploy_roles_postage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const func: DeployFunction = async function ({ deployments, getNamedAccounts })
const { deployer } = await getNamedAccounts();

log('Setting PostageStamps roles');
const adminRole = await read('StakeRegistry', 'DEFAULT_ADMIN_ROLE');
const adminRole = await read('PostageStamp', 'DEFAULT_ADMIN_ROLE');

if (await read('PostageStamp', { from: deployer }, 'hasRole', adminRole)) {
const priceOracleRole = await read('PostageStamp', 'PRICE_ORACLE_ROLE');
Expand Down
3 changes: 0 additions & 3 deletions deploy/main/007_deploy_roles_staking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ const func: DeployFunction = async function ({ deployments, getNamedAccounts })
const { deployer } = await getNamedAccounts();

log('Setting Staking roles');
// As currently we are reusing staking, and there is multisig wallet as ADMIN
// we either need to add deployer temporarly as ADMIN or do this manually over multisig

const adminRole = await read('StakeRegistry', 'DEFAULT_ADMIN_ROLE');

if (await read('StakeRegistry', { from: deployer }, 'hasRole', adminRole)) {
Expand Down
3 changes: 3 additions & 0 deletions deploy/main/008_deploy_roles_oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ const func: DeployFunction = async function ({ deployments, getNamedAccounts })
if (await read('StakeRegistry', { from: deployer }, 'hasRole', adminRole)) {
const redisAddress = (await get('Redistribution')).address;
const updaterRole = await read('PriceOracle', 'PRICE_UPDATER_ROLE');
// We need to do this here and not in constructor as oracle is deployed before redis in order of deployment so it would be old
// redis assigned, can't be solved with calculating the contract address in front as we dont know the nonce of redis,
// depends on if there will be a new staking contract or not
await execute('PriceOracle', { from: deployer }, 'grantRole', updaterRole, redisAddress);
} else {
log('DEPLOYER NEEDS TO HAVE ADMIN ROLE TO ASSIGN THE REDISTRIBUTION ROLE, PLEASE ASSIGN IT OR GRANT ROLE MANUALLY');
Expand Down
15 changes: 7 additions & 8 deletions deploy/main/011_deploy_multisig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,29 @@ const func: DeployFunction = async function ({ deployments, getNamedAccounts, ne
const { deployer } = await getNamedAccounts();

if (network.name == 'mainnet') {
log('Deploy multisig to all contracts, remove deployer');
log('Deploy multisig to all contracts');

// ADD Roles to Multisig
// TODO should uniform roles on contracts, recommend to just use DEFAULT_ADMIN_ROLE for pausing all contracts in future as it is in Oracle contract
// TODO should uniform roles on contracts, recommend to just use DEFAULT_ADMIN_ROLE also for postagestamp contract
const adminRole = await read('PostageStamp', 'DEFAULT_ADMIN_ROLE');
const pauserRole = await read('PostageStamp', 'PAUSER_ROLE');

Check warning on line 15 in deploy/main/011_deploy_multisig.ts

View workflow job for this annotation

GitHub Actions / check

'pauserRole' is assigned a value but never used
// await execute('PostageStamp', { from: deployer }, 'grantRole', adminRole, networkConfig['mainnet'].multisig);
// await execute('PostageStamp', { from: deployer }, 'grantRole', pauserRole, networkConfig['mainnet'].multisig);
// await execute('StakeRegistry', { from: deployer }, 'grantRole', adminRole, networkConfig['mainnet'].multisig);
// await execute('StakeRegistry', { from: deployer }, 'grantRole', pauserRole, networkConfig['mainnet'].multisig);
// await execute('PriceOracle', { from: deployer }, 'grantRole', adminRole, networkConfig['mainnet'].multisig);

await execute('StakeRegistry', { from: deployer }, 'grantRole', adminRole, networkConfig['mainnet'].multisig);
await execute('Redistribution', { from: deployer }, 'grantRole', adminRole, networkConfig['mainnet'].multisig);
await execute('Redistribution', { from: deployer }, 'grantRole', pauserRole, networkConfig['mainnet'].multisig);

// REMOVE Roles from deployer
// REMOVE Roles from deployer,
// ATTENTION probably will never use this, rather manaully confirm there is multistig admin role present and then renounce deployer, error would be catastrophic
// await execute('PostageStamp', { from: deployer }, 'renounceRole', adminRole, deployer);
// await execute('PostageStamp', { from: deployer }, 'renounceRole', pauserRole, deployer);
// await execute('StakeRegistry', { from: deployer }, 'renounceRole', adminRole, deployer);
// await execute('StakeRegistry', { from: deployer }, 'renounceRole', pauserRole, deployer);
// await execute('PriceOracle', { from: deployer }, 'renounceRole', adminRole, deployer);

await execute('Redistribution', { from: deployer }, 'renounceRole', adminRole, deployer);
await execute('Redistribution', { from: deployer }, 'renounceRole', pauserRole, deployer);
// await execute('Redistribution', { from: deployer }, 'renounceRole', adminRole, deployer);
// await execute('Redistribution', { from: deployer }, 'renounceRole', pauserRole, deployer);

log('----------------------------------------------------');
}
Expand Down
192 changes: 83 additions & 109 deletions deployments/mainnet/Redistribution.json

Large diffs are not rendered by default.

Loading

0 comments on commit cf64768

Please sign in to comment.