Skip to content

Commit

Permalink
Merge branch 'feat/new-methods'
Browse files Browse the repository at this point in the history
  • Loading branch information
balasan committed Dec 10, 2021
2 parents 99f52b1 + a8e8dda commit 3493fe7
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 47 deletions.
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": "0x0e222b72aa888cb58f873f1d828bae537e2568efb155ee50bec11b593b400ec0",
"txHash": "0xe97adbfa3d2de7bfbbc4c3c5b77d91c435d86e54c9299dff6e2606f13b590a89",
"layout": {
"storage": [
{
Expand Down
27 changes: 27 additions & 0 deletions deploy/00_updateRelOwnership.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const { network } = 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
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') return
// const [RelevantToken] = OZ_SDK_EXPORT.networks.mainnet.proxies[
// 'REL/RelevantToken'
// ]
// const RelevantTokenV2 = await ethers.getContractFactory(
// 'RelevantToken',
// relOwner,
// )
// const relv2 = RelevantTokenV2.attach(RelevantToken.address)
// const proxyAdminSigner = await setupAccount(proxyAdmin)
// await upgradeRel(proxyAdminSigner)
// const deployerS = await ethers.getSigner(deployer)
// await initV3(deployerS, relAdmin)
// return true
}
module.exports.tags = ['Rel']
module.exports.id = 'v3'
9 changes: 9 additions & 0 deletions deploy/00_upgradeRel.js → deploy/00_upgradeRelToV3.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { network } = 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 @@ -19,6 +20,14 @@ module.exports = async ({ getNamedAccounts, deployments }) => {

const deployerS = await setupAccount(deployer)
await initV3(deployerS, relAdmin)
return true
}

const proxyAdminSigner = await setupAccount(proxyAdmin)
await upgradeRel(proxyAdminSigner)
const deployerS = await ethers.getSigner(deployer)
await initV3(deployerS, relAdmin)
return true
}
module.exports.tags = ['Rel']
module.exports.id = 'v3'
11 changes: 7 additions & 4 deletions deploy/02_deploySRel.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@ module.exports = async ({ getNamedAccounts, deployments }) => {
log: true,
})

// set sRel as vesting contract
const deployerS = await setupAccount(deployer)
const rel = await getRelContract(deployerS)
const sRel = await deployments.get('sRel')
await rel.setVestingContract(sRel.address)

// transfer 1000 Rel into sRel to test vesting
if (network.name == 'hardhat') {
const sRel = await deployments.get('sRel')
const deployerS = await setupAccount(deployer)
const rel = await getRelContract(deployerS)
await rel.vestAllocatedTokens(sRel.address, parseUnits('1000'))
await rel.vestAllocatedTokens(parseUnits('1000'))
}
}

Expand Down
3 changes: 3 additions & 0 deletions deployments/localhost/.migrations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"v3": 1639178256
}
20 changes: 10 additions & 10 deletions deployments/localhost/Utils.json

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions deployments/localhost/sRel.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion openzeppelin-cli-export.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
{
"address": "0xd05e0e497a570Ad0a1402375561293Bd01e9cb73",
"version": "0.2.0",
"implementation": "0x988b89a36c66380dF8ea342b93b249770f3780e6"
"implementation": "0x988b89a36c66380dF8ea342b93b249770f3780e6",
"admin": "0xe1E72Eb7207FC113BD37fc7c4C36CBbae40c420D"
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion test/RelevantV3.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ describe('Relevant V3', function () {
await expect(
rel.connect(s1).updateAllocatedRewards('1'),
).to.be.revertedWith('')
await expect(rel.connect(s2.sweep(re.address, '1'))).to.be.revertedWith(
await expect(rel.connect(s2.sweep(rel.address, '1'))).to.be.revertedWith(
'Rel: not authorized',
)
await expect(rel.connect(s2).setAdmin(s2.address)).to.be.revertedWith(
Expand Down

0 comments on commit 3493fe7

Please sign in to comment.