Skip to content

Commit

Permalink
fix: Post v0.9.1 cleanups (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xCardinalError authored Sep 24, 2024
1 parent cf64768 commit 777ba87
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ Feel free to use public RPCs but if you want extra security and speed, feel free
## Releasing
To release a new rc version, tag the commit with the `-rcX` suffix, where `X` is the release candidate number.
For example, to release `v0.4.0-rc1`, execute the following command: `git tag v0.4.0-rc1 && git push origin v0.4.0-rc1`.
For example, to release `v0.9.1-rc1`, execute the following command: `git tag v0.9.1-rc1 && git push origin v0.9.1-rc1`.
This will generate Golang source code for the smart contracts and publish it to the [`ethersphere/go-storage-incentives-abi`](https://github.com/ethersphere/go-storage-incentives-abi) repository.
It'll also generate .env file with the bytecodes and publish it to the [`ethersphere/docker-setup-contracts`](https://github.com/ethersphere/docker-setup-contracts) repository.
The values for the Golang source code and .env file are taken from the [testnet_deployed.json](testnet_deployed.json) file, (see the [Deployment](#deployment) section).
To release a new stable version, tag the commit without the `-rcX` suffix.
For example, to release `v0.4.0`, execute the following command: `git tag v0.4.0 && git push origin v0.4.0`.
For example, to release `v0.9.1`, execute the following command: `git tag v0.9.1 && git push origin v0.9.1`.
This will generate Golang source code for the smart contracts and publish it to the [`ethersphere/go-storage-incentives-abi`](https://github.com/ethersphere/go-storage-incentives-abi) repository.
The values for the Golang source code file are taken from the [mainnet_deployed.json](mainnet_deployed.json) file (see the [Deployment](#deployment) section).
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 @@ -7,7 +7,7 @@ const func: DeployFunction = async function ({ deployments, getNamedAccounts })
log('Setting PostageStamps roles');
const adminRole = await read('PostageStamp', 'DEFAULT_ADMIN_ROLE');

if (await read('PostageStamp', { from: deployer }, 'hasRole', adminRole)) {
if (await read('PostageStamp', 'hasRole', adminRole, deployer)) {
const priceOracleRole = await read('PostageStamp', 'PRICE_ORACLE_ROLE');
await execute('PostageStamp', { from: deployer }, 'grantRole', priceOracleRole, (await get('PriceOracle')).address);

Expand Down
3 changes: 2 additions & 1 deletion deploy/main/007_deploy_roles_staking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ const func: DeployFunction = async function ({ deployments, getNamedAccounts })
log('Setting Staking roles');
const adminRole = await read('StakeRegistry', 'DEFAULT_ADMIN_ROLE');

if (await read('StakeRegistry', { from: deployer }, 'hasRole', adminRole)) {
if (await read('StakeRegistry', 'hasRole', adminRole, deployer)) {
const redisRole = await read('StakeRegistry', 'REDISTRIBUTOR_ROLE');
const redisAddress = (await get('Redistribution')).address;

await execute('StakeRegistry', { from: deployer }, 'grantRole', redisRole, redisAddress);
} else {
log('DEPLOYER NEEDS TO HAVE ADMIN ROLE TO ASSIGN THE REDISTRIBUTION ROLE, PLEASE ASSIGN IT OR GRANT ROLE MANUALLY');
Expand Down
6 changes: 3 additions & 3 deletions deploy/main/008_deploy_roles_oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const func: DeployFunction = async function ({ deployments, getNamedAccounts })

log('Setting Oracles roles');

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

if (await read('StakeRegistry', { from: deployer }, 'hasRole', adminRole)) {
if (await read('PriceOracle', 'hasRole', adminRole, deployer)) {
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
Expand All @@ -23,4 +23,4 @@ const func: DeployFunction = async function ({ deployments, getNamedAccounts })
};

export default func;
func.tags = ['staking_roles', 'roles'];
func.tags = ['oracle_roles', 'roles'];
2 changes: 1 addition & 1 deletion deploy/tenderly/007_deploy_roles_staking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const func: DeployFunction = async function ({ deployments, getNamedAccounts })
const redisAddress = (await get('Redistribution')).address;
const adminRole = await read('StakeRegistry', 'DEFAULT_ADMIN_ROLE');

if (await read('StakeRegistry', { from: deployer }, 'hasRole', adminRole, deployer)) {
if (await read('StakeRegistry', 'hasRole', adminRole, deployer)) {
const redisRole = await read('StakeRegistry', 'REDISTRIBUTOR_ROLE');
await execute('StakeRegistry', { from: deployer }, 'grantRole', redisRole, redisAddress);
} else {
Expand Down

0 comments on commit 777ba87

Please sign in to comment.