Skip to content

Commit

Permalink
OGN Staking contract upgrade (#485)
Browse files Browse the repository at this point in the history
* rinkeby ousd staking upgrade

* mainnet ogn staking upgrade

* Show proxy implementation address in hardhat debug task
  • Loading branch information
Franck authored Jan 6, 2021
1 parent 1249fe1 commit 260ed61
Show file tree
Hide file tree
Showing 12 changed files with 735 additions and 46 deletions.
1 change: 1 addition & 0 deletions contracts/deploy/010_upgrade_single_asset_staking.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const {
log,
deployWithConfirmation,
executeProposal,
sendProposal,
} = require("../utils/deploy");
const { proposeArgs } = require("../utils/governor");
const { getTxOpts } = require("../utils/tx");
Expand Down
3 changes: 2 additions & 1 deletion contracts/deployments/mainnet/.migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"004_single_asset_staking": 1608192583,
"007_upgrade_single_asset_staking": 1608527258,
"008_ousd_reset": 1609285987,
"009_ousd_fix": 1609736357
"009_ousd_fix": 1609736357,
"010_upgrade_single_asset_staking": 1609971639
}
58 changes: 38 additions & 20 deletions contracts/deployments/mainnet/SingleAssetStaking.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion contracts/deployments/rinkeby/.migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"004_single_asset_staking": 1608185799,
"007_upgrade_single_asset_staking": 1608526958,
"008_ousd_reset": 1609285987,
"009_ousd_fix": 1609652662
"009_ousd_fix": 1609652662,
"010_upgrade_single_asset_staking": 1609968697
}
58 changes: 38 additions & 20 deletions contracts/deployments/rinkeby/SingleAssetStaking.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions contracts/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,30 +209,52 @@ task(

const governor = await hre.ethers.getContract("Governor");

const ognStakingProxy = await hre.ethers.getContract("OGNStakingProxy");
const ognStaking = await hre.ethers.getContract("SingleAssetStaking");

//
// Addresses
//
console.log("\nContract addresses");
console.log("====================");
console.log(`OUSD proxy: ${ousdProxy.address}`);
console.log(`OUSD impl: ${await ousdProxy.implementation()}`);
console.log(`OUSD: ${cOusd.address}`);
console.log(`Vault proxy: ${vaultProxy.address}`);
console.log(
`Vault impl: ${await vaultProxy.implementation()}`
);
console.log(`Vault: ${cVault.address}`);
console.log(`Vault core: ${vaultCore.address}`);
console.log(`Vault admin: ${vaultAdmin.address}`);
console.log(`AaveStrategy proxy: ${aaveProxy.address}`);
console.log(`AaveStrategy impl: ${await aaveProxy.implementation()}`);
console.log(`AaveStrategy: ${cAaveStrategy.address}`);
console.log(`CompoundStrategy proxy: ${compoundProxy.address}`);
console.log(
`CompoundStrategy impl: ${await compoundProxy.implementation()}`
);
console.log(`CompoundStrategy: ${cCompoundStrategy.address}`);
if (!isMainnetOrRinkebyOrFork) {
console.log(`CurveUSDCStrategy proxy: ${curveUSDCStrategyProxy.address}`);
console.log(
`CurveUSDCStrategy imply: ${await curveUSDCStrategyProxy.implementation()}`
);
console.log(`CurveUSDCStrategy: ${cCurveUSDCStrategy.address}`);
console.log(`CurveUSDTStrategy proxy: ${curveUSDTStrategyProxy.address}`);
console.log(
`CurveUSDTStrategy impl: ${await curveUSDTStrategyProxy.implementation()}`
);
console.log(`CurveUSDTStrategy: ${cCurveUSDTStrategy.address}`);
}
console.log(`MixOracle: ${mixOracle.address}`);
console.log(`ChainlinkOracle: ${chainlinkOracle.address}`);
console.log(`Governor: ${governor.address}`);
console.log(`OGNStaking proxy: ${ognStakingProxy.address}`);
console.log(
`OGNStaking proxy impl: ${await ognStakingProxy.implementation()}`
);
console.log(`OGNStaking: ${ognStaking.address}`);

//
// Governor
Expand Down
2 changes: 1 addition & 1 deletion contracts/utils/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ const sendProposal = async (proposalArgs, description) => {
const governor = await ethers.getContract("Governor");

log(`Submitting proposal for ${description} to governor ${governor.address}`);
log(`Args: ${proposalArgs}`)
log(`Args: ${JSON.stringify(proposalArgs, null, 2)}`)
await withConfirmation(
governor
.connect(sDeployer)
Expand Down
20 changes: 19 additions & 1 deletion dapp/network.mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -7137,7 +7137,7 @@
]
},
"SingleAssetStaking": {
"address": "0xF6c1a36a200c9aCc5046A86037Ffbe4e0eCb2d6a",
"address": "0x0Ed143d1D6d98f10db7151b66D76aA3956072b5a",
"abi": [
{
"constant": true,
Expand Down Expand Up @@ -7749,6 +7749,18 @@
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "duration",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "rate",
"type": "uint256"
}
],
"name": "Staked",
Expand All @@ -7768,6 +7780,12 @@
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "stakedAmount",
"type": "uint256"
}
],
"name": "Withdrawn",
Expand Down
20 changes: 19 additions & 1 deletion dapp/network.rinkeby.json
Original file line number Diff line number Diff line change
Expand Up @@ -16119,7 +16119,7 @@
]
},
"SingleAssetStaking": {
"address": "0x13Cce8457Bd81b6935E760599dc523a95B9527e8",
"address": "0xc21B8c7F598bD0b4e383ec8C0AAE2b8519C2Bd65",
"abi": [
{
"constant": true,
Expand Down Expand Up @@ -16731,6 +16731,18 @@
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "duration",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "rate",
"type": "uint256"
}
],
"name": "Staked",
Expand All @@ -16750,6 +16762,12 @@
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "stakedAmount",
"type": "uint256"
}
],
"name": "Withdrawn",
Expand Down
20 changes: 19 additions & 1 deletion dapp/prod.network.json
Original file line number Diff line number Diff line change
Expand Up @@ -7137,7 +7137,7 @@
]
},
"SingleAssetStaking": {
"address": "0xF6c1a36a200c9aCc5046A86037Ffbe4e0eCb2d6a",
"address": "0x0Ed143d1D6d98f10db7151b66D76aA3956072b5a",
"abi": [
{
"constant": true,
Expand Down Expand Up @@ -7749,6 +7749,18 @@
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "duration",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "rate",
"type": "uint256"
}
],
"name": "Staked",
Expand All @@ -7768,6 +7780,12 @@
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "stakedAmount",
"type": "uint256"
}
],
"name": "Withdrawn",
Expand Down

0 comments on commit 260ed61

Please sign in to comment.