Skip to content

Commit

Permalink
decrease rep cutoff
Browse files Browse the repository at this point in the history
  • Loading branch information
balasan committed Dec 11, 2021
1 parent 3493fe7 commit c20826d
Show file tree
Hide file tree
Showing 16 changed files with 292 additions and 1,914 deletions.
328 changes: 205 additions & 123 deletions .openzeppelin/rinkeby.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .openzeppelin/unknown-1337.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
},
"687169a07ebd449aed818c321cff4ff4993608d04c62deca787ca2c519fbb8e0": {
"address": "0x9f18428d1662d5736d43cf1f9AA29b8C8249C0f0",
"txHash": "0xe97adbfa3d2de7bfbbc4c3c5b77d91c435d86e54c9299dff6e2606f13b590a89",
"txHash": "0xfdf66f15c42a2ba9403bfb6325708498e6b3537393cf59af9bda5022c3882b41",
"layout": {
"storage": [
{
Expand Down
45 changes: 45 additions & 0 deletions deploy/00_transferRelAdminV3.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
const { network, ethers } = require('hardhat')
const { setupAccount } = require('../test/utils')
const OZ_SDK_EXPORT = require('../openzeppelin-cli-export.json')
const proxyAdminAbi = require('@openzeppelin/upgrades/build/contracts/ProxyAdmin.json')
.abi

// this script needs proxyAdmin key
module.exports = async ({ getNamedAccounts, deployments }) => {
const { deployer, proxyAdmin, relOwner, relAdmin } = await getNamedAccounts()

// this step should be done manually on the mainnet via upgrade script
if (network.name == 'hardhat') {
await setupAccount(proxyAdmin)
}

const [RelevantToken] = OZ_SDK_EXPORT.networks[network.name].proxies[
'REL/RelevantToken'
]

// const relv2 = RelevantTokenV2.attach(RelevantToken.address)
const relv2 = await ethers.getContractAt(
'RelevantToken',
RelevantToken.address,
relOwner,
)

const proxyAdminContract = await ethers.getContractAt(
proxyAdminAbi,
RelevantToken.admin,
proxyAdmin,
)

console.log('rink owner', await relv2.owner())
const tx = await proxyAdminContract.transferOwnership(deployer)
const res = await tx.wait()
console.log(res)

const tx2 = await relv2.transferOwnership(deployer)
const res2 = await tx2.wait()
console.log(res2)

return true
}
module.exports.tags = ['Proxy']
module.exports.id = 'ownership_v3'
27 changes: 0 additions & 27 deletions deploy/00_updateRelOwnership.js

This file was deleted.

7 changes: 3 additions & 4 deletions deploy/00_upgradeRelToV3.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const { network } = require('hardhat')
const { network, ethers } = require('hardhat')
const { setupAccount } = require('../test/utils')
const { upgradeRel, initV3, getRelContract } = require('../scripts/upgradeRel')
const { ethers } = require('ethers')

// upgrades of Rel are managed via the openzepellin plugin
// mainnet upgrade should run first
Expand All @@ -23,9 +22,9 @@ module.exports = async ({ getNamedAccounts, deployments }) => {
return true
}

const proxyAdminSigner = await setupAccount(proxyAdmin)
await upgradeRel(proxyAdminSigner)
const deployerS = await ethers.getSigner(deployer)
// console.log('dep', deployerS.address)
// await upgradeRel(deployerS)
await initV3(deployerS, relAdmin)
return true
}
Expand Down
1 change: 0 additions & 1 deletion deployments/localhost/.chainId

This file was deleted.

2 changes: 1 addition & 1 deletion deployments/localhost/.migrations.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"v3": 1639178256
"ownership_v3": 1639179447
}
39 changes: 0 additions & 39 deletions deployments/localhost/Utils.json

This file was deleted.

Loading

0 comments on commit c20826d

Please sign in to comment.