-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
``` reusing "MaintenanceLogic" at 0x84d6e16a767a85d34964f26094bb46b0b7a4c8ab deploying "RoninTrustedOrganizationLogic": deployed at 0x99eb65715BD3A13895f0AAa669F36524c050DC03 deploying "SlashIndicatorLogic": deployed at 0xfe054b9e34f0C3CaB2043e289D646b3a98538AC9 reusing "StakingVestingLogic" at 0x3b62667358ae2b7611ae6451d5a244d9013db143 deploying "StakingLogic" (tx: 0x9c95ad9583c78bef5b822aa7636bc78a2aaa9572e82e911ffe69b0949a7cbf3e)...: deployed at 0x47FF1a3E1d8A43898Dd0BDd97e63Fe1B14087DdB with 3282482 gas deploying "RoninValidatorSetLogic": deployed at 0x679f49c06ee7c0e6b7c4f0f869a534a3533c7dd2 ``` ``` Propose Tx: https://saigon-app.roninchain.com/tx/0x040d1c8078b16070ab4860d327bf8821d79739dedce2aa57e6a1ef0f5c556896 Execute Tx: https://saigon-app.roninchain.com/tx/0x2c23b2603c0e0d0f58def3daf6fc3a3a5c87aebf9e26ebd36393d528652015e7?t=overview ```
- Loading branch information
Showing
12 changed files
with
1,664 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
248 changes: 224 additions & 24 deletions
248
deployments/ronin-testnet/RoninTrustedOrganizationLogic.json
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
262 changes: 262 additions & 0 deletions
262
deployments/ronin-testnet/solcInputs/6da162a003a00b6a8800b1f2bcac773f.json
Large diffs are not rendered by default.
Oops, something went wrong.
604 changes: 604 additions & 0 deletions
604
deployments/ronin-testnet/solcInputs/95921af9e3b453fd5a2d5edf43163a69.json
Large diffs are not rendered by default.
Oops, something went wrong.
217 changes: 217 additions & 0 deletions
217
deployments/ronin-testnet/solcInputs/d85d6f97c6f4b4f4d9c883d9b13849c8.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
src/upgrades/REP-002/230814-s7-upgrade-missing-dpos-contract-v0.6.1-testnet.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
import { explorerUrl, proxyInterface } from '../upgradeUtils'; | ||
import { VoteType } from '../../script/proposal'; | ||
import { RoninTrustedOrganization__factory, RoninGatewayV2__factory } from '../../types'; | ||
import { generalRoninConf, roninchainNetworks } from '../../configs/config'; | ||
import { network } from 'hardhat'; | ||
|
||
const deploy = async ({ getNamedAccounts, deployments, ethers }: HardhatRuntimeEnvironment) => { | ||
if (!roninchainNetworks.includes(network.name!)) { | ||
return; | ||
} | ||
|
||
const { execute } = deployments; | ||
let { governor } = await getNamedAccounts(); // NOTE: Should double check the `governor` account in the `hardhat.config.ts` file | ||
console.log('Governor:', governor); | ||
|
||
// Upgrade Ronin Trusted Org Contract | ||
const RoninTrustedOrganizationProxy = await deployments.get('RoninTrustedOrganizationProxy'); | ||
const RoninTrustedOrganizationLogic = await deployments.get('RoninTrustedOrganizationLogic'); | ||
const RoninTrustedOrganizationInstr = [ | ||
proxyInterface.encodeFunctionData('upgradeTo', [RoninTrustedOrganizationLogic.address]), | ||
]; | ||
console.info('RoninTrustedOrganizationInstr', RoninTrustedOrganizationInstr); | ||
|
||
// Upgrade Slash Indicator Contract | ||
const SlashIndicatorProxy = await deployments.get('SlashIndicatorProxy'); | ||
const SlashIndicatorLogic = await deployments.get('SlashIndicatorLogic'); | ||
const SlashIndicatorInstr = [proxyInterface.encodeFunctionData('upgradeTo', [SlashIndicatorLogic.address])]; | ||
console.info('SlashIndicatorInstr', SlashIndicatorInstr); | ||
|
||
// Upgrade Staking Contract | ||
const StakingProxy = await deployments.get('StakingProxy'); | ||
const StakingLogic = await deployments.get('StakingLogic'); | ||
const StakingInstr = [proxyInterface.encodeFunctionData('upgradeTo', [StakingLogic.address])]; | ||
console.info('StakingInstr', StakingInstr); | ||
|
||
// Upgrade Ronin Validator Set Contract | ||
const RoninValidatorSetProxy = await deployments.get('RoninValidatorSetProxy'); | ||
const RoninValidatorSetLogic = await deployments.get('RoninValidatorSetLogic'); | ||
const RoninValidatorSetInstr = [proxyInterface.encodeFunctionData('upgradeTo', [RoninValidatorSetLogic.address])]; | ||
console.info('RoninValidatorSetInstr', RoninValidatorSetInstr); | ||
|
||
// Propose the proposal | ||
const blockNumBefore = await ethers.provider.getBlockNumber(); | ||
const blockBefore = await ethers.provider.getBlock(blockNumBefore); | ||
const timestampBefore = blockBefore.timestamp; | ||
const proposalExpiryTimestamp = timestampBefore + 3600 * 24 * 10; // expired in 10 days | ||
|
||
// NOTE: Should double check the RoninGovernanceAdmin address in `deployments` folder is 0x946397deDFd2f79b75a72B322944a21C3240c9c3 | ||
const tx = await execute( | ||
'RoninGovernanceAdmin', | ||
{ from: governor, log: true }, | ||
'proposeProposalForCurrentNetwork', | ||
proposalExpiryTimestamp, // expiryTimestamp | ||
[ | ||
...RoninTrustedOrganizationInstr.map(() => RoninTrustedOrganizationProxy.address), | ||
...SlashIndicatorInstr.map(() => SlashIndicatorProxy.address), | ||
...StakingInstr.map(() => StakingProxy.address), | ||
...RoninValidatorSetInstr.map(() => RoninValidatorSetProxy.address), | ||
], // targets | ||
[...RoninTrustedOrganizationInstr, ...SlashIndicatorInstr, ...StakingInstr, ...RoninValidatorSetInstr].map(() => 0), // values | ||
[...RoninTrustedOrganizationInstr, ...SlashIndicatorInstr, ...StakingInstr, ...RoninValidatorSetInstr], // datas | ||
[...RoninTrustedOrganizationInstr, ...SlashIndicatorInstr, ...StakingInstr, ...RoninValidatorSetInstr].map( | ||
() => 1_000_000 | ||
), // gasAmounts | ||
VoteType.For // ballot type | ||
); | ||
|
||
deployments.log(`${explorerUrl[network.name!]}/tx/${tx.transactionHash}`); | ||
}; | ||
|
||
// yarn hardhat deploy --tags 230814_S7_UpgradeMissingDPoSContract_V0_6_1 --network ronin-testnet | ||
deploy.tags = ['230814_S7_UpgradeMissingDPoSContract_V0_6_1']; | ||
|
||
export default deploy; |
84 changes: 84 additions & 0 deletions
84
src/upgrades/REP-002/230814-vote-s7-upgrade-missing-dpos-contract-v0.6.1-testnet.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
import { explorerUrl, proxyInterface } from '../upgradeUtils'; | ||
import { VoteType } from '../../script/proposal'; | ||
import { roninchainNetworks } from '../../configs/config'; | ||
import { network } from 'hardhat'; | ||
|
||
const deploy = async ({ getNamedAccounts, deployments, ethers }: HardhatRuntimeEnvironment) => { | ||
if (!roninchainNetworks.includes(network.name!)) { | ||
return; | ||
} | ||
|
||
const { execute } = deployments; | ||
let { governor } = await getNamedAccounts(); // NOTE: Should double check the `governor` account in the `hardhat.config.ts` file | ||
console.log('Governor:', governor); | ||
|
||
// Upgrade Ronin Trusted Org Contract | ||
const RoninTrustedOrganizationProxy = await deployments.get('RoninTrustedOrganizationProxy'); | ||
const RoninTrustedOrganizationLogic = await deployments.get('RoninTrustedOrganizationLogic'); | ||
const RoninTrustedOrganizationInstr = [ | ||
proxyInterface.encodeFunctionData('upgradeTo', [RoninTrustedOrganizationLogic.address]), | ||
]; | ||
console.info('RoninTrustedOrganizationInstr', RoninTrustedOrganizationInstr); | ||
|
||
// Upgrade Slash Indicator Contract | ||
const SlashIndicatorProxy = await deployments.get('SlashIndicatorProxy'); | ||
const SlashIndicatorLogic = await deployments.get('SlashIndicatorLogic'); | ||
const SlashIndicatorInstr = [proxyInterface.encodeFunctionData('upgradeTo', [SlashIndicatorLogic.address])]; | ||
console.info('SlashIndicatorInstr', SlashIndicatorInstr); | ||
|
||
// Upgrade Staking Contract | ||
const StakingProxy = await deployments.get('StakingProxy'); | ||
const StakingLogic = await deployments.get('StakingLogic'); | ||
const StakingInstr = [proxyInterface.encodeFunctionData('upgradeTo', [StakingLogic.address])]; | ||
console.info('StakingInstr', StakingInstr); | ||
|
||
// Upgrade Ronin Validator Set Contract | ||
const RoninValidatorSetProxy = await deployments.get('RoninValidatorSetProxy'); | ||
const RoninValidatorSetLogic = await deployments.get('RoninValidatorSetLogic'); | ||
const RoninValidatorSetInstr = [proxyInterface.encodeFunctionData('upgradeTo', [RoninValidatorSetLogic.address])]; | ||
console.info('RoninValidatorSetInstr', RoninValidatorSetInstr); | ||
|
||
// Propose the proposal | ||
|
||
const proposalExpiryTimestamp = 0x64e848e9; | ||
|
||
const tx = await execute( | ||
'RoninGovernanceAdmin', | ||
{ from: governor, log: true }, | ||
'castProposalVoteForCurrentNetwork', | ||
|
||
// uint256 nonce; | ||
// uint256 chainId; | ||
// uint256 expiryTimestamp; | ||
// address[] targets; | ||
// uint256[] values; | ||
// bytes[] calldatas; | ||
// uint256[] gasAmounts; | ||
[ | ||
0xe, | ||
2021, | ||
proposalExpiryTimestamp, // expiryTimestamp | ||
[ | ||
...RoninTrustedOrganizationInstr.map(() => RoninTrustedOrganizationProxy.address), | ||
...SlashIndicatorInstr.map(() => SlashIndicatorProxy.address), | ||
...StakingInstr.map(() => StakingProxy.address), | ||
...RoninValidatorSetInstr.map(() => RoninValidatorSetProxy.address), | ||
], // targets | ||
[...RoninTrustedOrganizationInstr, ...SlashIndicatorInstr, ...StakingInstr, ...RoninValidatorSetInstr].map( | ||
() => 0 | ||
), // values | ||
[...RoninTrustedOrganizationInstr, ...SlashIndicatorInstr, ...StakingInstr, ...RoninValidatorSetInstr], // datas | ||
[...RoninTrustedOrganizationInstr, ...SlashIndicatorInstr, ...StakingInstr, ...RoninValidatorSetInstr].map( | ||
() => 1_000_000 | ||
), // gasAmounts | ||
], | ||
VoteType.For // ballot type | ||
); | ||
deployments.log(`${explorerUrl[network.name!]}/tx/${tx.transactionHash}`); | ||
}; | ||
|
||
// yarn hardhat deploy --tags 230814_Vote_S7_UpgradeMissingDPoSContract_V0_6_1 --network ronin-testnet | ||
deploy.tags = ['230814_Vote_S7_UpgradeMissingDPoSContract_V0_6_1']; | ||
|
||
export default deploy; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters