-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from RootstockCollective/gnosis-safe-upgrade
Gnosis safe upgrade
- Loading branch information
Showing
6 changed files
with
45 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* StRIF contract v.2 implementation deployment module | ||
*/ | ||
import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' | ||
|
||
export const stRifV02ImplementationModule = buildModule('stRifV02Implementation', m => { | ||
const stRifV02Implementation = m.contract('StRIFTokenV02', [], { id: 'Implementation' }) | ||
|
||
return { stRifV02Implementation } | ||
}) | ||
export default stRifV02ImplementationModule |
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,6 @@ | ||
{ | ||
"stRifProxy": { | ||
"owner": "0x8ee0a7e48fd05ebcd5e717a743526b8bc7fe2c0e", | ||
"rifAddress": "0x19F64674D8A5B4E652319F5e239eFd3bc969A1fE" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"StRIFTokenV02": { | ||
"StRifAddress": "0x47955BbC3a077FFA59BD7aedf25fcD1f2f0360e3" | ||
"StRifAddress": "0x4861198e9A6814EBfb152552D1b1a37426C54D23" | ||
} | ||
} |
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,20 @@ | ||
import { task } from 'hardhat/config' | ||
import StRifV02ImplementationModule from '../ignition/modules/StRifV2ImplementationModule' | ||
import { StRIFTokenV02 } from '../typechain-types' | ||
|
||
task('upgrade-strif-v2', 'Upgrade StRIF from v.1 to v.2') | ||
.addParam('id', 'Ignition deployment ID') | ||
.setAction(async ({ id }, hre) => { | ||
try { | ||
// deploy new StRIF implementation | ||
const v2 = (await hre.ignition.deploy(StRifV02ImplementationModule, { deploymentId: id })) | ||
.stRifV02Implementation as unknown as StRIFTokenV02 | ||
// encode the call of reinitializer on the new implementation | ||
const initializeV2Call = v2.interface.encodeFunctionData('initializeV2') | ||
console.log( | ||
`New Implementation: ${await v2.getAddress()}\nUpgrade transaction data: ${initializeV2Call}`, | ||
) | ||
} catch (error) { | ||
console.log(error instanceof Error ? error.message : error) | ||
} | ||
}) |