-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploy 117 - OETH Fixed Rate Dripper #2351
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
d88d411
feat: add OETH Fixed Rate Dripper.
clement-ux ab5c0e1
feat: add new function to Dripper.
clement-ux 64fedfc
fix: adjust deployment file.
clement-ux 1b488bc
fix: allow to transferERC20 to custom receiver.
clement-ux 5f1361e
prettier.
clement-ux e5729d6
fix: adjust deployment script.
clement-ux b836478
fix: remove hardcoded addresses.
clement-ux d6e4165
docs: adjust comments.
clement-ux 3462275
Deploy OETH Fixed Rate Dripper
clement-ux f024b1c
fix: add proposal description.
clement-ux ce7a383
feat: add proposal Id.
clement-ux 16bedbc
fix: adjust proposal id.
clement-ux b2bb713
Merge branch 'master' into clement/deploy_117
shahthepro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import { FixedRateDripper } from "./FixedRateDripper.sol"; | ||
|
||
/** | ||
* @title OETH FixedRateDripper Contract | ||
* @author Origin Protocol Inc | ||
*/ | ||
contract OETHFixedRateDripper is FixedRateDripper { | ||
constructor(address _vault, address _token) | ||
FixedRateDripper(_vault, _token) | ||
{} | ||
} |
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
100 changes: 100 additions & 0 deletions
100
contracts/deploy/mainnet/117_oeth_fixed_rate_dripper.js
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,100 @@ | ||
const addresses = require("../../utils/addresses"); | ||
const { deploymentWithGovernanceProposal } = require("../../utils/deploy"); | ||
|
||
module.exports = deploymentWithGovernanceProposal( | ||
{ | ||
deployName: "117_oeth_fixed_rate_dripper", | ||
forceDeploy: false, | ||
//forceSkip: true, | ||
reduceQueueTime: true, | ||
deployerIsProposer: false, | ||
proposalId: | ||
"27194273192096049001033521868815029294031516460891881333743928574609945488001", | ||
}, | ||
async ({ deployWithConfirmation, withConfirmation }) => { | ||
const cOETHVaultProxy = await ethers.getContractAt( | ||
"VaultAdmin", | ||
addresses.mainnet.OETHVaultProxy | ||
); | ||
|
||
// Deployer Actions | ||
// ---------------- | ||
const { deployerAddr } = await getNamedAccounts(); | ||
const sDeployer = await ethers.provider.getSigner(deployerAddr); | ||
|
||
// 1. Deploy new implementation of OETH Dripper (with transferAllToken function) | ||
// 2. Deploy new OETH fixed rate dripper (proxy + implementation) | ||
// 3. Upgrade Dripper to the new version (with transferAll token function) | ||
// 4. Transfer all funds from old dripper to new dripper | ||
// 5. Set new dripper on the vault | ||
|
||
// --- 1 --- | ||
// 1.a. Get the current OETH Dripper Proxy | ||
const cOETHDripperProxy = await ethers.getContract("OETHDripperProxy"); | ||
|
||
// 1.b. Deploy the new OETH Dripper implementation (with transferAllToken function) | ||
const dOETHDripper = await deployWithConfirmation( | ||
"OETHDripper", | ||
[addresses.mainnet.OETHVaultProxy, addresses.mainnet.WETH], | ||
undefined, | ||
true // due to changing name from `perBlock` to `perSecond` | ||
); | ||
|
||
const cOETHDripper = await ethers.getContractAt( | ||
"OETHDripper", | ||
cOETHDripperProxy.address | ||
); | ||
|
||
// --- 2 --- | ||
// 2.a Deploy the Fixed Rate Dripper Proxy | ||
const dOETHFixedRateDripperProxy = await deployWithConfirmation( | ||
"OETHFixedRateDripperProxy" | ||
); | ||
|
||
const cOETHFixedRateDripperProxy = await ethers.getContract( | ||
"OETHFixedRateDripperProxy" | ||
); | ||
|
||
// 2.b. Deploy the OETH Fixed Rate Dripper implementation | ||
const dOETHFixedRateDripper = await deployWithConfirmation( | ||
"OETHFixedRateDripper", | ||
[addresses.mainnet.OETHVaultProxy, addresses.mainnet.WETH] | ||
); | ||
|
||
// 2.c. Initialize the Fixed Rate Dripper Proxy | ||
const initFunction = "initialize(address,address,bytes)"; | ||
await withConfirmation( | ||
cOETHFixedRateDripperProxy.connect(sDeployer)[initFunction]( | ||
dOETHFixedRateDripper.address, | ||
addresses.mainnet.Timelock, // governor | ||
"0x" // no init data | ||
) | ||
); | ||
// --- 3 & 4 & 5 --- | ||
// Governance Actions | ||
// ---------------- | ||
return { | ||
name: "Migrate OETH Dripper to Fixed Rate Dripper", | ||
actions: [ | ||
// 3. Upgrade the Dripper to the new version | ||
{ | ||
contract: cOETHDripperProxy, | ||
signature: "upgradeTo(address)", | ||
args: [dOETHDripper.address], | ||
}, | ||
// 4. Transfer all funds from the old dripper to the new dripper | ||
{ | ||
contract: cOETHDripper, | ||
signature: "transferAllToken(address,address)", | ||
args: [addresses.mainnet.WETH, cOETHFixedRateDripperProxy.address], | ||
}, | ||
// 5. Set new dripper address on the vault | ||
{ | ||
contract: cOETHVaultProxy, | ||
signature: "setDripper(address)", | ||
args: [dOETHFixedRateDripperProxy.address], | ||
}, | ||
], | ||
}; | ||
} | ||
); |
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.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its ok for now, but ideally the feature change PR would be separate from the deploy PR of that feature. Like you had a separate feature PR here then you can fork off of the feature branch to create the deployment branch that only has the deployment related files.