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

Esm ward test #334

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
6372113
reset to base spell
iamchrissmith Mar 31, 2023
dec50a1
additional reset to compile
iamchrissmith Mar 31, 2023
cc42539
add GSM delay change
iamchrissmith Mar 31, 2023
ffe4a87
turn office hours off
iamchrissmith Mar 31, 2023
c3efc5d
add delegate payments
iamchrissmith Mar 31, 2023
e807f70
add Responsible Facilitator Dai Streams
iamchrissmith Mar 31, 2023
74b4a32
add Responsible Facilitator MKR Streams
iamchrissmith Mar 31, 2023
cccb963
yank old SF-001 MKR streams
iamchrissmith Mar 31, 2023
38853c2
Responsible Facilitator MKR Transfers
iamchrissmith Mar 31, 2023
8774f21
use existing MKR transfer test
iamchrissmith Mar 31, 2023
d3d075c
add ecosystem actor dai streams
iamchrissmith Mar 31, 2023
f512d28
add ecosystem actor MKR vest
iamchrissmith Mar 31, 2023
eafa2e8
add RWA_LIQ_ORACLE authorization for ESM
iamchrissmith Apr 1, 2023
86c017e
add ecosystem actor dai transfers
iamchrissmith Apr 3, 2023
f1cc54c
fix timestamps and tests
iamchrissmith Apr 3, 2023
e36c23c
comment nits
iamchrissmith Apr 4, 2023
afca136
reorder and other minor changes
iamchrissmith Apr 4, 2023
be14b54
fix tech_wallet in tests
iamchrissmith Apr 4, 2023
83cf16d
Add esm blanket ward test
brianmcmichael Apr 4, 2023
28893c2
Move check to test
brianmcmichael Apr 4, 2023
9d5108f
Fix test
brianmcmichael Apr 4, 2023
d33add1
Check correct base
brianmcmichael Apr 4, 2023
0201c5b
Exceptions
brianmcmichael Apr 4, 2023
ac81928
Check for PP ward
brianmcmichael Apr 4, 2023
9387600
Use WardsAbstract
brianmcmichael Apr 4, 2023
4fc8850
Clear prev spell
brianmcmichael Apr 25, 2023
0ca4e99
upd copyright
brianmcmichael Apr 25, 2023
a964bcd
Test comment
brianmcmichael Apr 25, 2023
d7685c7
Add exceptions blanket
brianmcmichael Apr 25, 2023
a37052b
merge master, resolving conflicts
brianmcmichael Apr 25, 2023
456ef72
private tests
brianmcmichael Apr 25, 2023
890de84
Add break
brianmcmichael Apr 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
305 changes: 2 additions & 303 deletions src/DssSpell.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ interface VestLike {
contract DssSpellAction is DssAction {
// Provides a descriptive tag for bot consumption
// This should be modified weekly to provide a summary of the actions
// Hash: cast keccak -- "$(wget https://raw.githubusercontent.com/makerdao/community/7bedb063e5bb18d5628dcac49ee71abee7c52481/governance/votes/Executive%20vote%20-%20April%205%2C%202023.md -q -O - 2>/dev/null)"
// Hash: cast keccak -- "$(wget https://raw.githubusercontent.com/makerdao/community/TODO/governance/votes/TODO.md -q -O - 2>/dev/null)"
string public constant override description =
"2023-04-05 MakerDAO Executive Spell | Hash: 0xdb7e531aeab07fdb0708beefa566c737f300ce4d3272819038c02834a447577f";
"2023-XX-XX MakerDAO Executive Spell | Hash: TODO";

// Turn office hours off
function officeHours() public pure override returns (bool) {
Expand All @@ -61,308 +61,7 @@ contract DssSpellAction is DssAction {
uint256 internal constant MILLION = 10 ** 6;
uint256 internal constant WAD = 10 ** 18;

address internal immutable MCD_PAUSE = DssExecLib.getChangelogAddress("MCD_PAUSE");
address internal immutable MCD_VEST_DAI = DssExecLib.getChangelogAddress("MCD_VEST_DAI");
GemLike internal immutable MKR = GemLike(DssExecLib.mkr());
address internal immutable MCD_VEST_MKR_TREASURY = DssExecLib.getChangelogAddress("MCD_VEST_MKR_TREASURY");
address immutable internal ESM = DssExecLib.getChangelogAddress("MCD_ESM");
address immutable internal RWA_LIQ_ORACLE = DssExecLib.getChangelogAddress("MIP21_LIQUIDATION_ORACLE");

// 01 Mar 2023 12:00:00 AM UTC
uint256 public constant MAR_01_2023 = 1677628800;
// 01 Apr 2023 12:00:00 AM UTC
uint256 public constant APR_01_2023 = 1680307200;
// 29 Feb 2024 11:59:59 PM UTC
uint256 public constant FEB_29_2024 = 1709251199;
// 31 Mar 2024 11:59:59 PM UTC
uint256 public constant MAR_31_2024 = 1711929599;
// 01 Apr 2024 11:59:59 PM UTC
uint256 public constant APR_01_2024 = 1712015999;

// DELEGATES
address internal constant COLDIRON = 0x6634e3555DBF4B149c5AEC99D579A2469015AEca;
address internal constant FLIPFLOPFLAP = 0x688d508f3a6B0a377e266405A1583B3316f9A2B3;
address internal constant GFXLABS = 0xa6e8772af29b29B9202a073f8E36f447689BEef6;
address internal constant MHONKASALOTEEMULAU = 0x97Fb39171ACd7C82c439b6158EA2F71D26ba383d;
address internal constant PENNBLOCKCHAIN = 0x2165D41aF0d8d5034b9c266597c1A415FA0253bd;
address internal constant FEEDBLACKLOOPS = 0x80882f2A36d49fC46C3c654F7f9cB9a2Bf0423e1;
address internal constant STABLELAB = 0x3B91eBDfBC4B78d778f62632a4004804AC5d2DB0;
address internal constant LBSBLOCKCHAIN = 0xB83b3e9C8E3393889Afb272D354A7a3Bd1Fbcf5C;
address internal constant HKUSTEPI = 0x2dA0d746938Efa28C7DC093b1da286b3D8bAC34a;
address internal constant JUSTINCASE = 0xE070c2dCfcf6C6409202A8a210f71D51dbAe9473;
address internal constant FRONTIERRESEARCH = 0xA2d55b89654079987CF3985aEff5A7Bd44DA15A8;
address internal constant CODEKNIGHT = 0xf6006d4cF95d6CB2CD1E24AC215D5BF3bca81e7D;
address internal constant FLIPSIDE = 0x1ef753934C40a72a60EaB12A68B6f8854439AA78;
address internal constant ONESTONE = 0x4eFb12d515801eCfa3Be456B5F348D3CD68f9E8a;
address internal constant CONSENSYS = 0xE78658A8acfE982Fde841abb008e57e6545e38b3;
address internal constant ACREINVEST = 0x5b9C98e8A3D9Db6cd4B4B4C1F92D0A551D06F00D;

// RESPONSIBLE FACILITATORS
address internal constant GOV_ALPHA = 0x01D26f8c5cC009868A4BF66E268c17B057fF7A73;
address internal constant TECH = 0x2dC0420A736D1F40893B9481D8968E4D7424bC0B;
address internal constant STEAKHOUSE = 0xf737C76D2B358619f7ef696cf3F94548fEcec379;
address internal constant BA_LABS = 0xDfe08A40054685E205Ed527014899d1EDe49B892;

// ECOSYSTEM ACTORS
address internal constant PHOENIX_LABS_2 = 0x115F76A98C2268DaE6c1421eb6B08e4e1dF525dA;
address internal constant VIRIDIAN_STREAM = 0xbB8AA212267477C3dbfF6643E497919ec2E3dEC9;
address internal constant VIRIDIAN_TRANSFER = 0xA1E62c6321eEd0ECFcF2f382c8c82FD940D83c07;
address internal constant DEWIZ = 0xD8665628742cf54BBBB3b00B15d7E7a838a1b53a;
address internal constant SIDESTREAM = 0x87EcaaACEd3A02A37e7075dc45D3fEb49867d135;

function actions() public override {

// ----- GSM Pause Delay Reset to 48 Hours -----
PauseLike(MCD_PAUSE).setDelay(48 hours);

// ----- FINAL DELEGATE COMPENSATION -----
// FORUM: https://forum.makerdao.com/t/final-recognized-delegate-compensation-payments/20341
DssExecLib.sendPaymentFromSurplusBuffer(COLDIRON, 10_452);
DssExecLib.sendPaymentFromSurplusBuffer(FLIPFLOPFLAP, 10_452);
DssExecLib.sendPaymentFromSurplusBuffer(GFXLABS, 10_452);
DssExecLib.sendPaymentFromSurplusBuffer(MHONKASALOTEEMULAU, 9_929);
DssExecLib.sendPaymentFromSurplusBuffer(PENNBLOCKCHAIN, 9_568);
DssExecLib.sendPaymentFromSurplusBuffer(FEEDBLACKLOOPS, 9_408);
DssExecLib.sendPaymentFromSurplusBuffer(STABLELAB, 3_282);
DssExecLib.sendPaymentFromSurplusBuffer(LBSBLOCKCHAIN, 3_045);
DssExecLib.sendPaymentFromSurplusBuffer(HKUSTEPI, 2_607);
DssExecLib.sendPaymentFromSurplusBuffer(JUSTINCASE, 2_488);
DssExecLib.sendPaymentFromSurplusBuffer(FRONTIERRESEARCH, 2_421);
DssExecLib.sendPaymentFromSurplusBuffer(CODEKNIGHT, 630);
DssExecLib.sendPaymentFromSurplusBuffer(FLIPSIDE, 541);
DssExecLib.sendPaymentFromSurplusBuffer(ONESTONE, 314);
DssExecLib.sendPaymentFromSurplusBuffer(CONSENSYS, 154);
DssExecLib.sendPaymentFromSurplusBuffer(ACREINVEST, 33);

// ----- RESPONSIBLE FACILITATOR DAI STREAMS -----
// VOTE: https://vote.makerdao.com/polling/Qmbndmkr#vote-breakdown
// FORUM: https://mips.makerdao.com/mips/details/MIP113
// GovAlpha | 2023-04-01 to 2024-03-31 | 900,000 DAI | 0x01D26f8c5cC009868A4BF66E268c17B057fF7A73
VestLike(MCD_VEST_DAI).restrict(
VestLike(MCD_VEST_DAI).create(
GOV_ALPHA, // usr
900_000 * WAD, // tot
APR_01_2023, // bgn
MAR_31_2024 - APR_01_2023, // tau
0, // eta
address(0) // mgr
)
);
// TECH | 2023-04-01 to 2024-03-31 | 1,380,000 DAI | 0x2dC0420A736D1F40893B9481D8968E4D7424bC0B
VestLike(MCD_VEST_DAI).restrict(
VestLike(MCD_VEST_DAI).create(
TECH, // usr
1_380_000 * WAD, // tot
APR_01_2023, // bgn
MAR_31_2024 - APR_01_2023, // tau
0, // eta
address(0) // mgr
)
);
// Steakhouse Financial | 2023-04-01 to 2024-03-31 | 2,220,000 DAI | 0xf737C76D2B358619f7ef696cf3F94548fEcec379
VestLike(MCD_VEST_DAI).restrict(
VestLike(MCD_VEST_DAI).create(
STEAKHOUSE, // usr
2_220_000 * WAD, // tot
APR_01_2023, // bgn
MAR_31_2024 - APR_01_2023, // tau
0, // eta
address(0) // mgr
)
);
// FORUM: https://mips.makerdao.com/mips/details/MIP104
// BA Labs | 2023-03-01 to 2024-02-29 | 2,484,000 DAI | 0xDfe08A40054685E205Ed527014899d1EDe49B892
VestLike(MCD_VEST_DAI).restrict(
VestLike(MCD_VEST_DAI).create(
BA_LABS, // usr
2_484_000 * WAD, // tot
MAR_01_2023, // bgn
FEB_29_2024 - MAR_01_2023, // tau
0, // eta
address(0) // mgr
)
);
// BA Labs - Data Insights | 2023-04-01 to 2024-03-31 | 876,000 DAI | 0xDfe08A40054685E205Ed527014899d1EDe49B892
VestLike(MCD_VEST_DAI).restrict(
VestLike(MCD_VEST_DAI).create(
BA_LABS, // usr
876_000 * WAD, // tot
APR_01_2023, // bgn
MAR_31_2024 - APR_01_2023, // tau
0, // eta
address(0) // mgr
)
);

// ----- RESPONSIBLE FACILITATOR MKR STREAMS -----
// VOTE: https://vote.makerdao.com/polling/Qmbndmkr#vote-breakdown
// Increase allowance by new vesting delta
uint256 newVesting = 690 * WAD; // STEAKHOUSE
newVesting += 432 * WAD; // TECH
newVesting += 340 * WAD; // GovAlpha
newVesting += 180 * WAD; // BA Labs
newVesting += 252 * WAD; // Dewiz
newVesting += 120 * WAD; // Phoenix Labs
MKR.approve(address(MCD_VEST_MKR_TREASURY), MKR.allowance(address(this), address(MCD_VEST_MKR_TREASURY)) + newVesting);

// FORUM: https://mips.makerdao.com/mips/details/MIP113
// Steakhouse Financial | 2023-04-01 to 2024-03-31 | Cliff Date 2023-04-01 | 690 MKR
VestLike(MCD_VEST_MKR_TREASURY).restrict(
VestLike(MCD_VEST_MKR_TREASURY).create(
STEAKHOUSE, // usr
690 * WAD, // tot
APR_01_2023, // bgn
MAR_31_2024 - APR_01_2023, // tau
0, // eta
address(0) // mgr
)
);
// TECH | 2023-04-01 to 2024-03-31 | Cliff Date 2023-04-01 | 432 MKR
VestLike(MCD_VEST_MKR_TREASURY).restrict(
VestLike(MCD_VEST_MKR_TREASURY).create(
TECH, // usr
432 * WAD, // tot
APR_01_2023, // bgn
MAR_31_2024 - APR_01_2023, // tau
0, // eta
address(0) // mgr
)
);
// GovAlpha | 2023-04-01 to 2024-03-31 | Cliff Date 2023-04-01 | 340 MKR
VestLike(MCD_VEST_MKR_TREASURY).restrict(
VestLike(MCD_VEST_MKR_TREASURY).create(
GOV_ALPHA, // usr
340 * WAD, // tot
APR_01_2023, // bgn
MAR_31_2024 - APR_01_2023, // tau
0, // eta
address(0) // mgr
)
);
// FORUM: https://mips.makerdao.com/mips/details/MIP104
// BA Labs - Data Insights | 2023-04-01 to 2024-03-31 | Cliff Date 2023-04-01 | 180 MKR
VestLike(MCD_VEST_MKR_TREASURY).restrict(
VestLike(MCD_VEST_MKR_TREASURY).create(
BA_LABS, // usr
180 * WAD, // tot
APR_01_2023, // bgn
MAR_31_2024 - APR_01_2023, // tau
0, // eta
address(0) // mgr
)
);

// ----- Yank old SF-001 MKR Vesting Streams - being replaced with single stream to SF Wallet -----
// VOTE: N/A
// FORUM: https://mips.makerdao.com/mips/details/MIP113
VestLike(MCD_VEST_MKR_TREASURY).yank(18);
VestLike(MCD_VEST_MKR_TREASURY).yank(19);
VestLike(MCD_VEST_MKR_TREASURY).yank(30);
VestLike(MCD_VEST_MKR_TREASURY).yank(31);

// ----- Responsible Facilitator MKR Transfers -----
// VOTE: https://vote.makerdao.com/polling/Qmbndmkr#vote-breakdown
// GovAlpha - 226.64 MKR - 0x01D26f8c5cC009868A4BF66E268c17B057fF7A73
MKR.transfer(GOV_ALPHA, 226.64 ether); // NOTE: 'ether' is a keyword helper, only MKR is transferred here


// ----- Ecosystem Actor Dai Streams -----
// Forum: https://mips.makerdao.com/mips/details/MIP106

// Vote: https://vote.makerdao.com/polling/QmRxNdG7
// Phoenix Labs | 2023-04-01 to 2024-04-01 | 204,000 DAI | 0x115F76A98C2268DaE6c1421eb6B08e4e1dF525dA
VestLike(MCD_VEST_DAI).restrict(
VestLike(MCD_VEST_DAI).create(
PHOENIX_LABS_2, // usr
204_000 * WAD, // tot
APR_01_2023, // bgn
APR_01_2024 - APR_01_2023, // tau
0, // eta
address(0) // mgr
)
);

// Vote: https://vote.makerdao.com/polling/QmV9MR8B
// Viridian Protector Advisory Company | 2023-04-01 to 2024-04-01 | 1,029,000 DAI | 0xbB8AA212267477C3dbfF6643E497919ec2E3dEC9
VestLike(MCD_VEST_DAI).restrict(
VestLike(MCD_VEST_DAI).create(
VIRIDIAN_STREAM, // usr
1_029_000 * WAD, // tot
APR_01_2023, // bgn
APR_01_2024 - APR_01_2023, // tau
0, // eta
address(0) // mgr
)
);

// Vote: https://vote.makerdao.com/polling/QmVo7VXV
// dewiz | 2023-04-01 to 2024-04-01 | 1,800,000 DAI | 0xD8665628742cf54BBBB3b00B15d7E7a838a1b53a
VestLike(MCD_VEST_DAI).restrict(
VestLike(MCD_VEST_DAI).create(
DEWIZ, // usr
1_800_000 * WAD, // tot
APR_01_2023, // bgn
APR_01_2024 - APR_01_2023, // tau
0, // eta
address(0) // mgr
)
);

// Vote: https://vote.makerdao.com/polling/Qmd5R3Jz
// Sidestream | 2023-04-01 to 2024-04-01 | 850,950 DAI | 0x87EcaaACEd3A02A37e7075dc45D3fEb49867d135
VestLike(MCD_VEST_DAI).restrict(
VestLike(MCD_VEST_DAI).create(
SIDESTREAM, // usr
850_950 * WAD, // tot
APR_01_2023, // bgn
APR_01_2024 - APR_01_2023, // tau
0, // eta
address(0) // mgr
)
);

// ----- Ecosystem Actor MKR Streams -----
// VOTE: https://vote.makerdao.com/polling/Qmbndmkr#vote-breakdown

// VOTE: https://vote.makerdao.com/polling/QmVo7VXV
// dewiz | 2023-04-01 to 2024-04-01 | 252 MKR | 0xD8665628742cf54BBBB3b00B15d7E7a838a1b53a
VestLike(MCD_VEST_MKR_TREASURY).restrict(
VestLike(MCD_VEST_MKR_TREASURY).create(
DEWIZ, // usr
252 * WAD, // tot
APR_01_2023, // bgn
APR_01_2024 - APR_01_2023, // tau
0, // eta
address(0) // mgr
)
);

// VOTE: https://vote.makerdao.com/polling/QmRxNdG7
// Phoenix Labs | 2023-04-01 to 2024-04-01 | 120 MKR | 0x115F76A98C2268DaE6c1421eb6B08e4e1dF525dA
VestLike(MCD_VEST_MKR_TREASURY).restrict(
VestLike(MCD_VEST_MKR_TREASURY).create(
PHOENIX_LABS_2, // usr
120 * WAD, // tot
APR_01_2023, // bgn
APR_01_2024 - APR_01_2023, // tau
0, // eta
address(0) // mgr
)
);

// ----- Ecosystem Actor Dai Transfers -----
// VOTE: https://vote.makerdao.com/polling/Qmbndmkr#vote-breakdown

// VOTE: https://vote.makerdao.com/polling/QmRxNdG7
// Phoenix Labs - 347,100 DAI - 0x115F76A98C2268DaE6c1421eb6B08e4e1dF525dA
DssExecLib.sendPaymentFromSurplusBuffer(PHOENIX_LABS_2, 347_100);

// VOTE: https://vote.makerdao.com/polling/QmV9MR8B
// Viridian Protector Advisory Company - 257,250 DAI - 0xA1E62c6321eEd0ECFcF2f382c8c82FD940D83c07
DssExecLib.sendPaymentFromSurplusBuffer(VIRIDIAN_TRANSFER, 257_250);

// ----- Additional ESM authorization fix -----
DssExecLib.authorize(RWA_LIQ_ORACLE, ESM);
}
}

Expand Down
44 changes: 40 additions & 4 deletions src/DssSpell.t.base.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import "./test/rates.sol";
import "./test/addresses_mainnet.sol";
import "./test/addresses_deployers.sol";
import "./test/addresses_wallets.sol";
import "./test/esm_exceptions.sol";
import "./test/config.sol";

import {DssSpell} from "./DssSpell.sol";
Expand Down Expand Up @@ -144,10 +145,11 @@ interface AuthorityLike {
}

contract DssSpellTestBase is Config, DssTest {
Rates rates = new Rates();
Addresses addr = new Addresses();
Deployers deployers = new Deployers();
Wallets wallets = new Wallets();
Rates rates = new Rates();
Addresses addr = new Addresses();
Deployers deployers = new Deployers();
Wallets wallets = new Wallets();
EsmExceptions exceptions = new EsmExceptions();

// ADDRESSES
ChainlogAbstract chainLog = ChainlogAbstract( addr.addr("CHANGELOG"));
Expand Down Expand Up @@ -1999,4 +2001,38 @@ contract DssSpellTestBase is Config, DssTest {
vat.move(address(this), address(0x0), vat.dai(address(this)));
}

// Test checks that any contracts in the chainlog which are a ward of
// the pause proxy are also have the ESM authed. Any new contracts
// that are added to the chainlog should have an ESM auth if the
// pause proxy is authorized on them. If it is not necessary to remove
// proxy access after a shutdown event, it can be added to the
// test/esm_exceptions.sol array. Add a comment to indicate why this
// authorization is not necessary.
function _checkESMWards() internal {

_vote(address(spell));
_scheduleWaitAndCast(address(spell));
assertTrue(spell.done());

bytes32[] memory _tags = chainLog.list();
bytes32[] memory _exceptions = exceptions.list();

for (uint256 i = 0; i < _tags.length; i++) {
bool _found = false;
for (uint256 j = 0; j < _exceptions.length; j++) {
if (_tags[i] == _exceptions[j]) {
_found = true;
naszam marked this conversation as resolved.
Show resolved Hide resolved
}
}
if (!_found) {
address _tagAddr = chainLog.getAddress(_tags[i]);
(bool ok, bytes memory data) = address(_tagAddr).call(
abi.encodeWithSignature("wards(address)", address(esm))
);
if (ok && WardsAbstract(_tagAddr).wards(pauseProxy) == 1) {
assertEq(uint256(bytes32(data)), 1, _concat("TestError/not-esm-ward-", _tags[i]));
}
}
}
}
}
Loading