-
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.
- Loading branch information
Showing
11 changed files
with
916 additions
and
122 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
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
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
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
634 changes: 634 additions & 0 deletions
634
deployments/ronin-testnet/solcInputs/6d67256db1844d3deb1c932d686229ba.json
Large diffs are not rendered by default.
Oops, something went wrong.
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
53 changes: 53 additions & 0 deletions
53
src/upgrades/REP-003/230925-upgrade-and-init-profile-contract.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,53 @@ | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
import { explorerUrl, proxyInterface } from '../upgradeUtils'; | ||
import { VoteType } from '../../script/proposal'; | ||
import { roninchainNetworks } from '../../configs/config'; | ||
import { network } from 'hardhat'; | ||
import { Profile__factory } from '../../types'; | ||
|
||
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); | ||
|
||
const validatorContractAddress = (await deployments.get('RoninValidatorSetProxy')).address; | ||
|
||
// Upgrade Profile Contract | ||
const ProfileProxy = await deployments.get('ProfileProxy'); | ||
const ProfileLogic = await deployments.get('ProfileLogic'); | ||
const ProfileInstr = [ | ||
proxyInterface.encodeFunctionData('upgradeToAndCall', [ | ||
ProfileLogic.address, | ||
new Profile__factory().interface.encodeFunctionData('initialize', [validatorContractAddress]), | ||
]), | ||
]; | ||
console.info('ProfileInstr', ProfileInstr); | ||
|
||
// 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 | ||
|
||
const tx = await execute( | ||
'RoninGovernanceAdmin', | ||
{ from: governor, log: true }, | ||
'proposeProposalForCurrentNetwork', | ||
proposalExpiryTimestamp, // expiryTimestamp | ||
[...ProfileInstr.map(() => ProfileProxy.address)], // targets | ||
[...ProfileInstr].map(() => 0), // values | ||
[...ProfileInstr], // datas | ||
[...ProfileInstr].map(() => 1_000_000), // gasAmounts | ||
VoteType.For // ballot type | ||
); | ||
deployments.log(`${explorerUrl[network.name!]}/tx/${tx.transactionHash}`); | ||
}; | ||
|
||
// yarn hardhat deploy --tags 230925_UpgradeAndInitV1ProfileContractV0_6_3 --network ronin-testnet | ||
deploy.tags = ['230925_UpgradeAndInitV1ProfileContractV0_6_3']; | ||
|
||
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