Skip to content
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

CR Oracle + Timelock Ops #925

Merged
merged 5 commits into from
Jun 23, 2022
Merged

CR Oracle + Timelock Ops #925

merged 5 commits into from
Jun 23, 2022

Conversation

Joeysantoro
Copy link
Contributor

@Joeysantoro Joeysantoro commented Jun 21, 2022

PR Type: Feature

PR Description:

Executes a few cleanup actions related to collateralization and operations:

  1. Add a collateralization FEI lens to the FEI in the tribal council timelock and old rari timelocks
  2. Accept beneficiary of the old rari timelocks to tribal council timelock.
  3. Remove deprecated namedStaticPCVDeposit from collateralization oracle.
  4. Trigger new ETH LBP to convert 10k ETH to DAI.
  5. Grant tribal council safe the SWAP_ADMIN_ROLE to initiate LBPs after governance funds them.

PR Checklist - Feature (Proposal)

  • All Tests Passing
  • Proposal Added to ProposalsConfig
  • Fork Block Correct
  • Remove Any .only's on Tests
  • Update Documentation If Needed
  • Update Roles Config
  • Proposal Submitted

@Joeysantoro Joeysantoro requested a review from a team as a code owner June 21, 2022 23:36
@Joeysantoro
Copy link
Contributor Author

Joeysantoro commented Jun 21, 2022

EDIT: deleted old calldata

kryptoklob
kryptoklob previously approved these changes Jun 22, 2022
Copy link
Contributor

@thomas-waite thomas-waite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, few tidy up comments

// 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) => {
console.log('here');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Remove this console.log

// This should exclusively include new contract deployments
const deploy: DeployUpgradeFunc = async (deployAddress: string, addresses: NamedAddresses, logging: boolean) => {
const factory = (await hre.ethers.getContractFactory('ERC20PCVDepositWrapper')) as ERC20PCVDepositWrapper__factory;
const rariTimelockFeiOldLens = await factory.deploy(addresses.rariInfraFeiTimelock, addresses.fei, true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will make sure to add lenses for contracts with significant Fei that are becoming part of the Fei ecosystem in the future!

import { TemplatedProposalDescription } from '@custom-types/types';

const timelock_admin: TemplatedProposalDescription = {
title: 'Timelock Updates',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would probably add a TIP number?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup!


const proposals: TemplatedProposalsConfigMap = {
tip_111: {
// tip_111: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think this is leftover commenting and needs deleting? tokemak_withdraw and tip_112 can both be removed.

pod_exec_v2 needs to stay here, it hasn't been proposed/executed by the TC yet


// Increase PCV balance to exceed deviation threshold
const pcvStats = await collateralizationOracleWrapper.pcvStats();
await namedStaticPCVDepositWrapper.addDeposit({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test relies on named static PCV deposit which will be deprecated in this proposal. Erwan's #923 also deprecates the keeper

Copy link
Contributor

@thomas-waite thomas-waite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me, will give a final once over tomorrow then approve

values: '0',
method: 'grantRole(bytes32,address)',
arguments: (addresses) => [
'0x471cfe1a44bf1b786db7d7104d51e6728ed7b90a35394ad7cc424adf8ed16816', // SWAP_ADMIN_ROLE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, you can import ethers now and replace this with ethers.utils.id('SWAP_ADMIN_ROLE)

@@ -47,6 +52,9 @@ const validate: ValidateUpgradeFunc = async (addresses, oldContracts, contracts,
expect(await contracts.rariTimelockFeiOldLens.balanceReportedIn()).to.be.equal(addresses.fei);
expect(await contracts.tribalCouncilTimelockFeiLens.balanceReportedIn()).to.be.equal(addresses.fei);
expect(await contracts.namedStaticPCVDepositWrapper.numDeposits()).to.be.equal('0');
expect(await contracts.ethToDaiLBPSwapper.swapEndTime()).to.be.gt(
ethers.BigNumber.from((await time.latest()).toString())
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depends how confident are, but I would probably make sure you can do a swap via the LBP pool here

false,
false
],
description: 'Withdraw 10k ETH to LBP Swapper'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weights are 95 / 5 . You're sending $1m DAI and ~$10.5m ETH. So overfunding by $500k, should be fine

@Joeysantoro
Copy link
Contributor Author

Calldata:

0x8f2a0bb000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000000081216f2d37b0a60a2451f16caffab42bb8fa9a8e67d1daa520e241e3f85a61180000000000000000000000000000000000000000000000000000000000054600000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000ff6f59333cfd8f4ebc14ad0a0e181a83e655d257000000000000000000000000ff6f59333cfd8f4ebc14ad0a0e181a83e655d257000000000000000000000000ff6f59333cfd8f4ebc14ad0a0e181a83e655d25700000000000000000000000006dacca04e201ad31393754e68da04dc14778fa600000000000000000000000006dacca04e201ad31393754e68da04dc14778fa6000000000000000000000000fafc562265a49975e8b20707eac966473795cf90000000000000000000000000625cf6aa7dafb154f3eb6be87592110e30290dee00000000000000000000000002435948f84d7465fb71de45aba6098fc6ec299300000000000000000000000002435948f84d7465fb71de45aba6098fc6ec2993000000000000000000000000f7991f4698ffb6716982aec7f78964dd731c4a540000000000000000000000008d5ed43dca8c2f7dfb20cf7b53cc7e593635d7b9000000000000000000000000000000000000000000000000000000000000000b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000340000000000000000000000000000000000000000000000000000000000000038000000000000000000000000000000000000000000000000000000000000003c000000000000000000000000000000000000000000000000000000000000004a0000000000000000000000000000000000000000000000000000000000000058000000000000000000000000000000000000000000000000000000000000005c00000000000000000000000000000000000000000000000000000000000000024dea02892000000000000000000000000614d46b7eb2ac1a359b8835d64954f3ee4e6f676000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024dea028920000000000000000000000004037a70152f4c88ad40522f35bd4ddd17e6b20520000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240a633e0900000000000000000000000006dacca04e201ad31393754e68da04dc14778fa60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000244d6d199100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000244d6d199100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044929e1620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044929e1620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a4fe68d76e0000000000000000000000002a188f9eb761f70ecea083ba6c2a40145078dfc2000000000000000000000000f7991f4698ffb6716982aec7f78964dd731c4a5400000000000000000000000000000000000000000000d3c21bcecceda1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a4fe68d76e00000000000000000000000098e5f5706897074a4664dd3a32eb80242d6e694b000000000000000000000000f7991f4698ffb6716982aec7f78964dd731c4a5400000000000000000000000000000000000000000000021e19e0c9bab2400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000048119c0650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000442f2ff15d471cfe1a44bf1b786db7d7104d51e6728ed7b90a35394ad7cc424adf8ed168160000000000000000000000002ec598d8e3df35e5d6f13ae2f05a7bb2704e92ea00000000000000000000000000000000000000000000000000000000

Execute Calldata:

0xe38335e500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000003a0000000000000000000000000000000000000000000000000000000000000000081216f2d37b0a60a2451f16caffab42bb8fa9a8e67d1daa520e241e3f85a6118000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000ff6f59333cfd8f4ebc14ad0a0e181a83e655d257000000000000000000000000ff6f59333cfd8f4ebc14ad0a0e181a83e655d257000000000000000000000000ff6f59333cfd8f4ebc14ad0a0e181a83e655d25700000000000000000000000006dacca04e201ad31393754e68da04dc14778fa600000000000000000000000006dacca04e201ad31393754e68da04dc14778fa6000000000000000000000000fafc562265a49975e8b20707eac966473795cf90000000000000000000000000625cf6aa7dafb154f3eb6be87592110e30290dee00000000000000000000000002435948f84d7465fb71de45aba6098fc6ec299300000000000000000000000002435948f84d7465fb71de45aba6098fc6ec2993000000000000000000000000f7991f4698ffb6716982aec7f78964dd731c4a540000000000000000000000008d5ed43dca8c2f7dfb20cf7b53cc7e593635d7b9000000000000000000000000000000000000000000000000000000000000000b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000340000000000000000000000000000000000000000000000000000000000000038000000000000000000000000000000000000000000000000000000000000003c000000000000000000000000000000000000000000000000000000000000004a0000000000000000000000000000000000000000000000000000000000000058000000000000000000000000000000000000000000000000000000000000005c00000000000000000000000000000000000000000000000000000000000000024dea02892000000000000000000000000614d46b7eb2ac1a359b8835d64954f3ee4e6f676000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024dea028920000000000000000000000004037a70152f4c88ad40522f35bd4ddd17e6b20520000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240a633e0900000000000000000000000006dacca04e201ad31393754e68da04dc14778fa60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000244d6d199100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000244d6d199100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044929e1620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044929e1620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a4fe68d76e0000000000000000000000002a188f9eb761f70ecea083ba6c2a40145078dfc2000000000000000000000000f7991f4698ffb6716982aec7f78964dd731c4a5400000000000000000000000000000000000000000000d3c21bcecceda1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a4fe68d76e00000000000000000000000098e5f5706897074a4664dd3a32eb80242d6e694b000000000000000000000000f7991f4698ffb6716982aec7f78964dd731c4a5400000000000000000000000000000000000000000000021e19e0c9bab2400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000048119c0650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000442f2ff15d471cfe1a44bf1b786db7d7104d51e6728ed7b90a35394ad7cc424adf8ed168160000000000000000000000002ec598d8e3df35e5d6f13ae2f05a7bb2704e92ea00000000000000000000000000000000000000000000000000000000

Copy link
Contributor

@thomas-waite thomas-waite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks okay to me. I would add a validation that you can do a swap and that the implied price is reasonable first if there's time.

Have verified the propose and execute calldata, looks good

@Joeysantoro Joeysantoro merged commit ba785dc into develop Jun 23, 2022
@Joeysantoro Joeysantoro deleted the feat/timelockAdmin branch June 23, 2022 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants