-
Notifications
You must be signed in to change notification settings - Fork 95
FIP-28 + 29 #191
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
Merged
Merged
FIP-28 + 29 #191
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,74 @@ | ||
| import { expect } from "chai"; | ||
| import hre, { ethers } from "hardhat"; | ||
|
|
||
| const e18 = ethers.constants.WeiPerEther; | ||
|
|
||
| async function setup(addresses, oldContracts, contracts, logging) {} | ||
|
|
||
| async function run(addresses, oldContracts, contracts, logging = false) {} | ||
|
|
||
| async function teardown(addresses, oldContracts, contracts, logging) { | ||
| const { | ||
| optimisticTimelockAddress | ||
| } = addresses; | ||
|
|
||
| const { | ||
| rariPool8Comptroller, | ||
| rariPool8Dai, | ||
| rariPool8Tribe, | ||
| rariPool8Eth, | ||
| rariPool8Fei | ||
| } = contracts; | ||
|
|
||
| await hre.network.provider.request({ | ||
| method: 'hardhat_impersonateAccount', | ||
| params: [optimisticTimelockAddress], | ||
| }); | ||
|
|
||
| await (await ethers.getSigners())[0].sendTransaction({ | ||
| to: optimisticTimelockAddress, | ||
| value: ethers.utils.parseEther("10.0") | ||
| }); | ||
|
|
||
| await rariPool8Comptroller._acceptAdmin({from: optimisticTimelockAddress}); | ||
| await rariPool8Dai._acceptAdmin({from: optimisticTimelockAddress}); | ||
| await rariPool8Tribe._acceptAdmin({from: optimisticTimelockAddress}); | ||
| await rariPool8Eth._acceptAdmin({from: optimisticTimelockAddress}); | ||
| await rariPool8Fei._acceptAdmin({from: optimisticTimelockAddress}); | ||
| } | ||
|
|
||
| async function validate(addresses, oldContracts, contracts) { | ||
| const { | ||
| rariPool8Comptroller, | ||
| fei, | ||
| rariPool8Dai, | ||
| rariPool8Tribe, | ||
| rariPool8Eth, | ||
| rariPool8Fei, | ||
| rariPool22FeiPCVDeposit | ||
| } = contracts; | ||
|
|
||
| const { | ||
| optimisticTimelockAddress | ||
| } = addresses; | ||
|
|
||
| // Borrow disabled | ||
| expect(await rariPool8Comptroller.borrowGuardianPaused(rariPool8Tribe.address)).to.be.equal(true); | ||
|
|
||
| // minted FEI | ||
| // 1M from before, 50M from proposal | ||
| expect((await fei.balanceOf(optimisticTimelockAddress)).toString()).to.be.equal(e18.mul(51_000_000).toString()); | ||
|
|
||
| expect((await rariPool22FeiPCVDeposit.balance()).toString()).to.be.equal(e18.mul(1_000_000).toString()); | ||
|
|
||
| // admin transfer | ||
| expect(await rariPool8Comptroller.admin()).to.be.equal(optimisticTimelockAddress); | ||
| expect(await rariPool8Dai.admin()).to.be.equal(optimisticTimelockAddress); | ||
| expect(await rariPool8Tribe.admin()).to.be.equal(optimisticTimelockAddress); | ||
| expect(await rariPool8Eth.admin()).to.be.equal(optimisticTimelockAddress); | ||
| expect(await rariPool8Fei.admin()).to.be.equal(optimisticTimelockAddress); | ||
| } | ||
|
|
||
| module.exports = { | ||
| setup, run, teardown, validate | ||
| }; |
This file contains hidden or 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 hidden or 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,87 @@ | ||
| { | ||
| "proposal_title": "FIP-28/29 FeiRari TRIBE and Optimistic Approval", | ||
| "proposal_commands": [ | ||
| { | ||
| "target": "rariPool8Comptroller", | ||
| "values": "0", | ||
| "method": "_setBorrowPaused(address,bool)", | ||
| "arguments": [ | ||
| "0xFd3300A9a74b3250F1b2AbC12B47611171910b07", | ||
| true | ||
| ], | ||
| "description": "Make fTRIBE unborrowable" | ||
| }, | ||
| { | ||
| "target": "fei", | ||
| "values": "0", | ||
| "method": "mint(address,uint256)", | ||
| "arguments": [ | ||
| "0xbC9C084a12678ef5B516561df902fdc426d95483", | ||
| "50000000000000000000000000" | ||
| ], | ||
| "description": "Mint 50m FEI to Optimistic Timelock" | ||
| }, | ||
| { | ||
| "target": "rariPool8Comptroller", | ||
| "values": "0", | ||
| "method": "_setPendingAdmin(address)", | ||
| "arguments": [ | ||
| "0xbC9C084a12678ef5B516561df902fdc426d95483" | ||
| ], | ||
| "description": "set admin Comptroller" | ||
| }, | ||
| { | ||
| "target": "rariPool8Dai", | ||
| "values": "0", | ||
| "method": "_setPendingAdmin(address)", | ||
| "arguments": [ | ||
| "0xbC9C084a12678ef5B516561df902fdc426d95483" | ||
| ], | ||
| "description": "set admin fDAI" | ||
| }, | ||
| { | ||
| "target": "rariPool8Tribe", | ||
| "values": "0", | ||
| "method": "_setPendingAdmin(address)", | ||
| "arguments": [ | ||
| "0xbC9C084a12678ef5B516561df902fdc426d95483" | ||
| ], | ||
| "description": "set admin fTRIBE" | ||
| }, | ||
| { | ||
| "target": "rariPool8Eth", | ||
| "values": "0", | ||
| "method": "_setPendingAdmin(address)", | ||
| "arguments": [ | ||
| "0xbC9C084a12678ef5B516561df902fdc426d95483" | ||
| ], | ||
| "description": "set admin fETH" | ||
| }, | ||
| { | ||
| "target": "rariPool8Fei", | ||
| "values": "0", | ||
| "method": "_setPendingAdmin(address)", | ||
| "arguments": [ | ||
| "0xbC9C084a12678ef5B516561df902fdc426d95483" | ||
| ], | ||
| "description": "set admin fFEI" | ||
| }, | ||
| { | ||
| "target": "fei", | ||
| "values": "0", | ||
| "method": "mint(address,uint256)", | ||
| "arguments": [ | ||
| "0x7CeBaB7b4B4399343f6D0D36B550EE097F60d7fE", | ||
| "1000000000000000000000000" | ||
| ], | ||
| "description": "Mint 1m FEI to Fuse Pool 22" | ||
| }, | ||
| { | ||
| "target": "rariPool22FeiPCVDeposit", | ||
| "values": "0", | ||
| "method": "deposit()", | ||
| "arguments": [], | ||
| "description": "Deposit pool 22 FEI" | ||
| } | ||
| ] | ||
| } | ||
This file contains hidden or 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 @@ | ||
| FIP-28 text |
This file contains hidden or 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,30 @@ | ||
| const ERC20CompoundPCVDeposit = artifacts.require('ERC20CompoundPCVDeposit'); | ||
|
|
||
| async function deploy(deployAddress, addresses, logging = false) { | ||
| const { | ||
| coreAddress, | ||
| feiAddress, | ||
| rariPool22FeiAddress, | ||
| } = addresses; | ||
|
|
||
| if ( | ||
| !coreAddress || !feiAddress || !rariPool22FeiAddress | ||
| ) { | ||
| throw new Error('An environment variable contract address is not set'); | ||
| } | ||
|
|
||
| const rariPool22FeiPCVDeposit = await ERC20CompoundPCVDeposit.new( | ||
| coreAddress, | ||
| rariPool22FeiAddress, | ||
| feiAddress, | ||
| { from: deployAddress } | ||
| ); | ||
|
|
||
| logging && console.log('Rari Pool 22 FEI ERC20CompoundPCVDeposit deployed to: ', rariPool22FeiPCVDeposit.address); | ||
|
|
||
| return { | ||
| rariPool22FeiPCVDeposit | ||
| }; | ||
| } | ||
|
|
||
| module.exports = { deploy }; |
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.