-
Notifications
You must be signed in to change notification settings - Fork 99
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
Seed Turbo Fuse pool with Fei #702
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f7b100a
feat: setup turbo fuse pcv deposit
thomas-waite fb3e6e4
feat: add dao proposal and validate script
thomas-waite 48ba052
refactor: correct address to cToken address
thomas-waite 56738ae
test: impersonate address with TURBO_ADMIN_ROLE
thomas-waite a908b7e
Update PCVDeposit.sol
Joeysantoro 0095e26
refactor: replace overriden state vars with functions
thomas-waite a98b59c
feat: add missing PCV deposit wrapper addresses
thomas-waite 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
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,67 @@ | ||
import { ethers } from 'hardhat'; | ||
import { expect } from 'chai'; | ||
import { | ||
DeployUpgradeFunc, | ||
NamedAddresses, | ||
SetupUpgradeFunc, | ||
TeardownUpgradeFunc, | ||
ValidateUpgradeFunc | ||
} from '@custom-types/types'; | ||
import { getImpersonatedSigner } from '@test/helpers'; | ||
|
||
/* | ||
|
||
OA Proposal 97 | ||
|
||
Description: | ||
|
||
Steps: | ||
1. Deploy Turbo Fuse pool PCV deposit | ||
2. Transfer $10 million Fei to the PCV Deposit | ||
3. Deposit the Fei into the pool | ||
*/ | ||
|
||
const fipNumber = '97'; // Change me! | ||
|
||
// Do any deployments | ||
// This should exclusively include new contract deployments | ||
const deploy: DeployUpgradeFunc = async (deployAddress: string, addresses: NamedAddresses, logging: boolean) => { | ||
// 1. Deploy compound PCV deposit | ||
const erc20CompoundPCVDepositFactory = await ethers.getContractFactory('ERC20CompoundPCVDeposit'); | ||
const turboFusePCVDeposit = await erc20CompoundPCVDepositFactory.deploy(addresses.core, addresses.rariTurboFusePool); | ||
await turboFusePCVDeposit.deployTransaction.wait(); | ||
logging && console.log('Turbo PCV Deposit deployed to: ', turboFusePCVDeposit.address); | ||
|
||
return { | ||
turboFusePCVDeposit | ||
}; | ||
}; | ||
|
||
// Do any setup necessary for running the test. | ||
// This could include setting up Hardhat to impersonate accounts, | ||
// ensuring contracts have a specific state, etc. | ||
const setup: SetupUpgradeFunc = async (addresses, oldContracts, contracts, logging) => { | ||
// feiDAOTimelock is TURBO_ADMIN_ROLE | ||
const governorSigner = await getImpersonatedSigner(addresses.feiDAOTimelock); | ||
|
||
const turboAdminABI = ['function _setWhitelistStatuses(address[] calldata suppliers, bool[] calldata statuses)']; | ||
const turboAdmin = new ethers.Contract(addresses.turboAdmin, turboAdminABI, governorSigner); | ||
await turboAdmin._setWhitelistStatuses([contracts.turboFusePCVDeposit.address], [true]); | ||
}; | ||
|
||
// Tears down any changes made in setup() that need to be | ||
// cleaned up before doing any validation checks. | ||
const teardown: TeardownUpgradeFunc = async (addresses, oldContracts, contracts, logging) => { | ||
console.log(`No actions to complete in teardown for fip${fipNumber}`); | ||
}; | ||
|
||
// Run any validations required on the fip using mocha or console logging | ||
// IE check balances, check state of contracts, etc. | ||
const validate: ValidateUpgradeFunc = async (addresses, oldContracts, contracts, logging) => { | ||
// Validate 10M Fei was seeded | ||
const seedAmount = ethers.constants.WeiPerEther.mul(10_000_000); // 10 M | ||
const pcvBalance = await contracts.turboFusePCVDeposit.balance(); | ||
expect(pcvBalance).to.equal(seedAmount); | ||
}; | ||
|
||
export { deploy, setup, teardown, validate }; |
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,34 @@ | ||
import { ProposalDescription } from '@custom-types/types'; | ||
|
||
const fip_97: ProposalDescription = { | ||
title: 'FIP-97: Seed Turbo fuse pool with 10M Fei', | ||
commands: [ | ||
{ | ||
target: 'fei', | ||
values: '0', | ||
method: 'transfer', | ||
arguments: ['{turboFusePCVDeposit}', '10000000000000000000000000'], // 10M | ||
description: 'Transfer $10M FEI from optimistic timelock to the Turbo Fuse PCV deposit' | ||
}, | ||
{ | ||
target: 'turboFusePCVDeposit', | ||
values: '0', | ||
method: 'deposit()', | ||
arguments: [], | ||
description: 'Deposit ~$10M of Fei into Turbo Fuse Pool' | ||
}, | ||
{ | ||
target: 'collateralizationOracle', | ||
values: '0', | ||
method: 'addDeposits(address[])', | ||
arguments: [['{turboFusePCVDeposit}']], | ||
description: 'Add new PCV Deposits to CR oracle' | ||
} | ||
], | ||
description: ` | ||
OA action to seed Turbo fuse pool with $10M Fei. Transfer $10M Fei from the OA multisig to the Turbo Fuse PCV deposit | ||
and then deposit. Update the collaterization oracle to include the new deposit. | ||
` | ||
}; | ||
|
||
export default fip_97; |
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
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
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
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.
Ah. You'll need to do a wrapper because the PCV deposit doesn't accurately report FEI