Flattening difference (left is dapp.tools, right is foundry nightly-2cb8757)
177 removals
567 lines
158 additions
548 lines
/**
*Submitted for verification at Etherscan.io on 2024-01-24
*/
// hevm: flattened sources of src/DssSpell.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity =0.8.16 >=0.5.12 >=0.8.16 <0.9.0;
pragma solidity 0.8.16;
////// lib/dss-exec-lib/src/CollateralOpts.sol
//
//
// CollateralOpts.sol -- Data structure for onboarding collateral
// CollateralOpts.sol -- Data structure for onboarding collateral
//
//
// Copyright (C) 2020-2022 Dai Foundation
// Copyright (C) 2020-2022 Dai Foundation
//
//
// This program is free software: you can redistribute it and/or modify
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
// GNU Affero General Public License for more details.
//
//
// You should have received a copy of the GNU Affero General Public License
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// along with this program. If not, see <https://www.gnu.org/licenses/>.
/* pragma solidity ^0.8.16; */
struct CollateralOpts {
struct CollateralOpts {
bytes32 ilk;
bytes32 ilk;
address gem;
address gem;
address join;
address join;
address clip;
address clip;
address calc;
address calc;
address pip;
address pip;
bool isLiquidatable;
bool isLiquidatable;
bool isOSM;
bool isOSM;
bool whitelistOSM;
bool whitelistOSM;
uint256 ilkDebtCeiling;
uint256 ilkDebtCeiling;
uint256 minVaultAmount;
uint256 minVaultAmount;
uint256 maxLiquidationAmount;
uint256 maxLiquidationAmount;
uint256 liquidationPenalty;
uint256 liquidationPenalty;
uint256 ilkStabilityFee;
uint256 ilkStabilityFee;
uint256 startingPriceFactor;
uint256 startingPriceFactor;
uint256 breakerTolerance;
uint256 breakerTolerance;
uint256 auctionDuration;
uint256 auctionDuration;
uint256 permittedDrop;
uint256 permittedDrop;
uint256 liquidationRatio;
uint256 liquidationRatio;
uint256 kprFlatReward;
uint256 kprFlatReward;
uint256 kprPctReward;
uint256 kprPctReward;
}
}
////// lib/dss-exec-lib/src/DssExecLib.sol
//
// DssExec.sol -- MakerDAO Executive Spell Template
//
// Copyright (C) 2020-2022 Dai Foundation
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
Text moved from lines 333-404
interface PauseAbstract {
function delay() external view returns (uint256);
function plot(address, bytes32, bytes calldata, uint256) external;
function exec(address, bytes32, bytes calldata, uint256) external returns (bytes memory);
}
interface Changelog {
function getAddress(bytes32) external view returns (address);
}
interface SpellAction {
function officeHours() external view returns (bool);
function description() external view returns (string memory);
function nextCastTime(uint256) external view returns (uint256);
}
contract DssExec {
Changelog constant public log = Changelog(0xdA0Ab1e0017DEbCd72Be8599041a2aa3bA7e740F);
uint256 public eta;
bytes public sig;
bool public done;
bytes32 immutable public tag;
address immutable public action;
uint256 immutable public expiration;
PauseAbstract immutable public pause;
// Provides a descriptive tag for bot consumption
// This should be modified weekly to provide a summary of the actions
// Hash: seth keccak -- "$(wget https://<executive-vote-canonical-post> -q -O - 2>/dev/null)"
function description() external view returns (string memory) {
return SpellAction(action).description();
}
function officeHours() external view returns (bool) {
return SpellAction(action).officeHours();
}
function nextCastTime() external view returns (uint256 castTime) {
return SpellAction(action).nextCastTime(eta);
}
// @param _description A string description of the spell
// @param _expiration The timestamp this spell will expire. (Ex. block.timestamp + 30 days)
// @param _spellAction The address of the spell action
constructor(uint256 _expiration, address _spellAction) {
pause = PauseAbstract(log.getAddress("MCD_PAUSE"));
expiration = _expiration;
action = _spellAction;
sig = abi.encodeWithSignature("execute()");
bytes32 _tag; // Required for assembly access
address _action = _spellAction; // Required for assembly access
assembly { _tag := extcodehash(_action) }
tag = _tag;
}
function schedule() public {
require(block.timestamp <= expiration, "This contract has expired");
require(eta == 0, "This spell has already been scheduled");
eta = block.timestamp + PauseAbstract(pause).delay();
pause.plot(action, tag, sig, eta);
}
function cast() public {
require(!done, "spell-already-cast");
done = true;
pause.exec(action, tag, sig, eta);
}
}
// A base ERC-20 abstract class
// https://eips.ethereum.org/EIPS/eip-20
interface GemAbstract {
function totalSupply() external view returns (uint256);
function balanceOf(address) external view returns (uint256);
function allowance(address, address) external view returns (uint256);
function approve(address, uint256) external returns (bool);
function transfer(address, uint256) external returns (bool);
function transferFrom(address, address, uint256) external returns (bool);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
Text moved from lines 424-456
// https://github.com/makerdao/dss/blob/master/src/vat.sol
interface VatAbstract {
function wards(address) external view returns (uint256);
function rely(address) external;
function deny(address) external;
function can(address, address) external view returns (uint256);
function hope(address) external;
function nope(address) external;
function ilks(bytes32) external view returns (uint256, uint256, uint256, uint256, uint256);
function urns(bytes32, address) external view returns (uint256, uint256);
function gem(bytes32, address) external view returns (uint256);
function dai(address) external view returns (uint256);
function sin(address) external view returns (uint256);
function debt() external view returns (uint256);
function vice() external view returns (uint256);
function Line() external view returns (uint256);
function live() external view returns (uint256);
function init(bytes32) external;
function file(bytes32, uint256) external;
function file(bytes32, bytes32, uint256) external;
function cage() external;
function slip(bytes32, address, int256) external;
function flux(bytes32, address, address, uint256) external;
function move(address, address, uint256) external;
function frob(bytes32, address, address, address, int256, int256) external;
function fork(bytes32, address, address, int256, int256) external;
function grab(bytes32, address, address, address, int256, int256) external;
function heal(uint256) external;
function suck(address, address, uint256) external;
function fold(bytes32, address, int256) external;
}
//
//
// DssExecLib.sol -- MakerDAO Executive Spellcrafting Library
// DssExecLib.sol -- MakerDAO Executive Spellcrafting Library
//
//
// Copyright (C) 2020-2022 Dai Foundation
// Copyright (C) 2020-2022 Dai Foundation
//
//
// This program is free software: you can redistribute it and/or modify
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
// GNU Affero General Public License for more details.
//
//
// You should have received a copy of the GNU Affero General Public License
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// along with this program. If not, see <https://www.gnu.org/licenses/>.
/* pragma solidity ^0.8.16; */
/* import { CollateralOpts } from "./CollateralOpts.sol"; */
interface Initializable {
interface Initializable {
function init(bytes32) external;
function init(bytes32) external;
}
}
interface Authorizable {
interface Authorizable {
function rely(address) external;
function rely(address) external;
function deny(address) external;
function deny(address) external;
function setAuthority(address) external;
function setAuthority(address) external;
}
}
interface Fileable {
interface Fileable {
function file(bytes32, address) external;
function file(bytes32, address) external;
function file(bytes32, uint256) external;
function file(bytes32, uint256) external;
function file(bytes32, bytes32, uint256) external;
function file(bytes32, bytes32, uint256) external;
function file(bytes32, bytes32, address) external;
function file(bytes32, bytes32, address) external;
}
}
interface Drippable {
interface Drippable {
function drip() external returns (uint256);
function drip() external returns (uint256);
function drip(bytes32) external returns (uint256);
function drip(bytes32) external returns (uint256);
}
}
interface Pricing {
interface Pricing {
function poke(bytes32) external;
function poke(bytes32) external;
}
}
interface ERC20 {
interface ERC20 {
function decimals() external returns (uint8);
function decimals() external returns (uint8);
}
}
interface DssVat {
interface DssVat {
function hope(address) external;
function hope(address) external;
function nope(address) external;
function nope(address) external;
function ilks(bytes32) external returns (uint256 Art, uint256 rate, uint256 spot, uint256 line, uint256 dust);
function ilks(bytes32) external returns (uint256 Art, uint256 rate, uint256 spot, uint256 line, uint256 dust);
function Line() external view returns (uint256);
function Line() external view returns (uint256);
function suck(address, address, uint256) external;
function suck(address, address, uint256) external;
}
}
interface ClipLike {
interface ClipLike {
function vat() external returns (address);
function vat() external returns (address);
function dog() external returns (address);
function dog() external returns (address);
function spotter() external view returns (address);
function spotter() external view returns (address);
function calc() external view returns (address);
function calc() external view returns (address);
function ilk() external returns (bytes32);
function ilk() external returns (bytes32);
}
}
interface DogLike {
interface DogLike {
function ilks(bytes32) external returns (address clip, uint256 chop, uint256 hole, uint256 dirt);
function ilks(bytes32) external returns (address clip, uint256 chop, uint256 hole, uint256 dirt);
}
}
interface JoinLike {
interface JoinLike {
function vat() external returns (address);
function vat() external returns (address);
function ilk() external returns (bytes32);
function ilk() external returns (bytes32);
function gem() external returns (address);
function gem() external returns (address);
function dec() external returns (uint256);
function dec() external returns (uint256);
function join(address, uint256) external;
function join(address, uint256) external;
function exit(address, uint256) external;
function exit(address, uint256) external;
}
}
// Includes Median and OSM functions
// Includes Median and OSM functions
interface OracleLike_2 {
interface OracleLike_0 {
function src() external view returns (address);
function src() external view returns (address);
function lift(address[] calldata) external;
function lift(address[] calldata) external;
function drop(address[] calldata) external;
function drop(address[] calldata) external;
function setBar(uint256) external;
function setBar(uint256) external;
function kiss(address) external;
function kiss(address) external;
function diss(address) external;
function diss(address) external;
function kiss(address[] calldata) external;
function kiss(address[] calldata) external;
function diss(address[] calldata) external;
function diss(address[] calldata) external;
function orb0() external view returns (address);
function orb0() external view returns (address);
function orb1() external view returns (address);
function orb1() external view returns (address);
}
}
interface MomLike {
interface MomLike {
function setOsm(bytes32, address) external;
function setOsm(bytes32, address) external;
function setPriceTolerance(address, uint256) external;
function setPriceTolerance(address, uint256) external;
}
}
interface RegistryLike {
interface RegistryLike {
function add(address) external;
function add(address) external;
function xlip(bytes32) external view returns (address);
function xlip(bytes32) external view returns (address);
}
}
// https://github.com/makerdao/dss-chain-log
// https://github.com/makerdao/dss-chain-log
interface ChainlogLike {
interface ChainlogLike {
function setVersion(string calldata) external;
function setVersion(string calldata) external;
function setIPFS(string calldata) external;
function setIPFS(string calldata) external;
function setSha256sum(string calldata) external;
function setSha256sum(string calldata) external;
function getAddress(bytes32) external view returns (address);
function getAddress(bytes32) external view returns (address);
function setAddress(bytes32, address) external;
function setAddress(bytes32, address) external;
function removeAddress(bytes32) external;
function removeAddress(bytes32) external;
}
}
interface IAMLike {
interface IAMLike {
function ilks(bytes32) external view returns (uint256,uint256,uint48,uint48,uint48);
function ilks(bytes32) external view returns (uint256,uint256,uint48,uint48,uint48);
function setIlk(bytes32,uint256,uint256,uint256) external;
function setIlk(bytes32,uint256,uint256,uint256) external;
function remIlk(bytes32) external;
function remIlk(bytes32) external;
function exec(bytes32) external returns (uint256);
function exec(bytes32) external returns (uint256);
}
}
interface LerpFactoryLike {
interface LerpFactoryLike {
function newLerp(bytes32 name_, address target_, bytes32 what_, uint256 startTime_, uint256 start_, uint256 end_, uint256 duration_) external returns (address);
function newLerp(bytes32 name_, address target_, bytes32 what_, uint256 startTime_, uint256 start_, uint256 end_, uint256 duration_) external returns (address);
function newIlkLerp(bytes32 name_, address target_, bytes32 ilk_, bytes32 what_, uint256 startTime_, uint256 start_, uint256 end_, uint256 duration_) external returns (address);
function newIlkLerp(bytes32 name_, address target_, bytes32 ilk_, bytes32 what_, uint256 startTime_, uint256 start_, uint256 end_, uint256 duration_) external returns (address);
}
}
interface LerpLike {
interface LerpLike {
function tick() external returns (uint256);
function tick() external returns (uint256);
}
}
interface RwaOracleLike {
interface RwaOracleLike {
function bump(bytes32 ilk, uint256 val) external;
function bump(bytes32 ilk, uint256 val) external;
}
}
library DssExecLib {
library DssExecLib {
/* WARNING
/* WARNING
The following library code acts as an interface to the actual DssExecLib
The following library code acts as an interface to the actual DssExecLib
library, which can be found in its own deployed contract. Only trust the actual
library, which can be found in its own deployed contract. Only trust the actual
library's implementation.
library's implementation.
*/
*/
address constant public LOG = 0xdA0Ab1e0017DEbCd72Be8599041a2aa3bA7e740F;
address constant public LOG = 0xdA0Ab1e0017DEbCd72Be8599041a2aa3bA7e740F;
uint256 constant internal WAD = 10 ** 18;
uint256 constant internal WAD = 10 ** 18;
uint256 constant internal RAY = 10 ** 27;
uint256 constant internal RAY = 10 ** 27;
uint256 constant internal RAD = 10 ** 45;
uint256 constant internal RAD = 10 ** 45;
uint256 constant internal THOUSAND = 10 ** 3;
uint256 constant internal THOUSAND = 10 ** 3;
uint256 constant internal MILLION = 10 ** 6;
uint256 constant internal MILLION = 10 ** 6;
uint256 constant internal BPS_ONE_PCT = 100;
uint256 constant internal BPS_ONE_PCT = 100;
uint256 constant internal BPS_ONE_HUNDRED_PCT = 100 * BPS_ONE_PCT;
uint256 constant internal BPS_ONE_HUNDRED_PCT = 100 * BPS_ONE_PCT;
uint256 constant internal RATES_ONE_HUNDRED_PCT = 1000000021979553151239153027;
uint256 constant internal RATES_ONE_HUNDRED_PCT = 1000000021979553151239153027;
function wdiv(uint256 x, uint256 y) internal pure returns (uint256 z) {}
function wdiv(uint256 x, uint256 y) internal pure returns (uint256 z) {}
function mkr() public view returns (address) { return getChangelogAddress("MCD_GOV"); }
function mkr() public view returns (address) { return getChangelogAddress("MCD_GOV"); }
function vat() public view returns (address) { return getChangelogAddress("MCD_VAT"); }
function vat() public view returns (address) { return getChangelogAddress("MCD_VAT"); }
function dog() public view returns (address) { return getChangelogAddress("MCD_DOG"); }
function dog() public view returns (address) { return getChangelogAddress("MCD_DOG"); }
function jug() public view returns (address) { return getChangelogAddress("MCD_JUG"); }
function jug() public view returns (address) { return getChangelogAddress("MCD_JUG"); }
function pot() public view returns (address) { return getChangelogAddress("MCD_POT"); }
function pot() public view returns (address) { return getChangelogAddress("MCD_POT"); }
function vow() public view returns (address) { return getChangelogAddress("MCD_VOW"); }
function vow() public view returns (address) { return getChangelogAddress("MCD_VOW"); }
function end() public view returns (address) { return getChangelogAddress("MCD_END"); }
function end() public view returns (address) { return getChangelogAddress("MCD_END"); }
function esm() public view returns (address) { return getChangelogAddress("MCD_ESM"); }
function esm() public view returns (address) { return getChangelogAddress("MCD_ESM"); }
function reg() public view returns (address) { return getChangelogAddress("ILK_REGISTRY"); }
function reg() public view returns (address) { return getChangelogAddress("ILK_REGISTRY"); }
function spotter() public view returns (address) { return getChangelogAddress("MCD_SPOT"); }
function spotter() public view returns (address) { return getChangelogAddress("MCD_SPOT"); }
function flap() public view returns (address) { return getChangelogAddress("MCD_FLAP"); }
function flap() public view returns (address) { return getChangelogAddress("MCD_FLAP"); }
function autoLine() public view returns (address) { return getChangelogAddress("MCD_IAM_AUTO_LINE"); }
function autoLine() public view returns (address) { return getChangelogAddress("MCD_IAM_AUTO_LINE"); }
function lerpFab() public view returns (address) { return getChangelogAddress("LERP_FAB"); }
function lerpFab() public view returns (address) { return getChangelogAddress("LERP_FAB"); }
function clip(bytes32 _ilk) public view returns (address _clip) {}
function clip(bytes32 _ilk) public view returns (address _clip) {}
function flip(bytes32 _ilk) public view returns (address _flip) {}
function flip(bytes32 _ilk) public view returns (address _flip) {}
function calc(bytes32 _ilk) public view returns (address _calc) {}
function calc(bytes32 _ilk) public view returns (address _calc) {}
function getChangelogAddress(bytes32 _key) public view returns (address) {}
function getChangelogAddress(bytes32 _key) public view returns (address) {}
function setChangelogAddress(bytes32 _key, address _val) public {}
function setChangelogAddress(bytes32 _key, address _val) public {}
function setChangelogVersion(string memory _version) public {}
function setChangelogVersion(string memory _version) public {}
function authorize(address _base, address _ward) public {}
function authorize(address _base, address _ward) public {}
function setAuthority(address _base, address _authority) public {}
function setAuthority(address _base, address _authority) public {}
function canCast(uint40 _ts, bool _officeHours) public pure returns (bool) {}
function canCast(uint40 _ts, bool _officeHours) public pure returns (bool) {}
function nextCastTime(uint40 _eta, uint40 _ts, bool _officeHours) public pure returns (uint256 castTime) {}
function nextCastTime(uint40 _eta, uint40 _ts, bool _officeHours) public pure returns (uint256 castTime) {}
function updateCollateralPrice(bytes32 _ilk) public {}
function updateCollateralPrice(bytes32 _ilk) public {}
function setValue(address _base, bytes32 _what, uint256 _amt) public {}
function setValue(address _base, bytes32 _what, uint256 _amt) public {}
function setValue(address _base, bytes32 _ilk, bytes32 _what, uint256 _amt) public {}
function setValue(address _base, bytes32 _ilk, bytes32 _what, uint256 _amt) public {}
function setIlkDebtCeiling(bytes32 _ilk, uint256 _amount) public {}
function setIlkDebtCeiling(bytes32 _ilk, uint256 _amount) public {}
function removeIlkFromAutoLine(bytes32 _ilk) public {}
function removeIlkFromAutoLine(bytes32 _ilk) public {}
function setIlkLiquidationPenalty(bytes32 _ilk, uint256 _pct_bps) public {}
function setIlkLiquidationPenalty(bytes32 _ilk, uint256 _pct_bps) public {}
function setKeeperIncentivePercent(bytes32 _ilk, uint256 _pct_bps) public {}
function setKeeperIncentivePercent(bytes32 _ilk, uint256 _pct_bps) public {}
function setKeeperIncentiveFlatRate(bytes32 _ilk, uint256 _amount) public {}
function setKeeperIncentiveFlatRate(bytes32 _ilk, uint256 _amount) public {}
function setIlkStabilityFee(bytes32 _ilk, uint256 _rate, bool _doDrip) public {}
function setIlkStabilityFee(bytes32 _ilk, uint256 _rate, bool _doDrip) public {}
function linearInterpolation(bytes32 _name, address _target, bytes32 _ilk, bytes32 _what, uint256 _startTime, uint256 _start, uint256 _end, uint256 _duration) public returns (address) {}
function linearInterpolation(bytes32 _name, address _target, bytes32 _ilk, bytes32 _what, uint256 _startTime, uint256 _start, uint256 _end, uint256 _duration) public returns (address) {}
}
}
////// lib/dss-exec-lib/src/DssAction.sol
//
//
// DssAction.sol -- DSS Executive Spell Actions
// DssAction.sol -- DSS Executive Spell Actions
//
//
// Copyright (C) 2020-2022 Dai Foundation
// Copyright (C) 2020-2022 Dai Foundation
//
//
// This program is free software: you can redistribute it and/or modify
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
// GNU Affero General Public License for more details.
//
//
// You should have received a copy of the GNU Affero General Public License
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// along with this program. If not, see <https://www.gnu.org/licenses/>.
/* pragma solidity ^0.8.16; */
/* import { DssExecLib } from "./DssExecLib.sol"; */
/* import { CollateralOpts } from "./CollateralOpts.sol"; */
interface OracleLike_1 {
interface OracleLike_1 {
function src() external view returns (address);
function src() external view returns (address);
}
}
abstract contract DssAction {
abstract contract DssAction {
using DssExecLib for *;
using DssExecLib for *;
// Modifier used to limit execution time when office hours is enabled
// Modifier used to limit execution time when office hours is enabled
modifier limited {
modifier limited {
require(DssExecLib.canCast(uint40(block.timestamp), officeHours()), "Outside office hours");
require(DssExecLib.canCast(uint40(block.timestamp), officeHours()), "Outside office hours");
_;
_;
}
}
// Office Hours defaults to true by default.
// Office Hours defaults to true by default.
// To disable office hours, override this function and
// To disable office hours, override this function and
// return false in the inherited action.
// return false in the inherited action.
function officeHours() public view virtual returns (bool) {
function officeHours() public view virtual returns (bool) {
return true;
return true;
}
}
// DssExec calls execute. We limit this function subject to officeHours modifier.
// DssExec calls execute. We limit this function subject to officeHours modifier.
function execute() external limited {
function execute() external limited {
actions();
actions();
}
}
// DssAction developer must override `actions()` and place all actions to be called inside.
// DssAction developer must override `actions()` and place all actions to be called inside.
// The DssExec function will call this subject to the officeHours limiter
// The DssExec function will call this subject to the officeHours limiter
// By keeping this function public we allow simulations of `execute()` on the actions outside of the cast time.
// By keeping this function public we allow simulations of `execute()` on the actions outside of the cast time.
function actions() public virtual;
function actions() public virtual;
// Provides a descriptive tag for bot consumption
// Provides a descriptive tag for bot consumption
// This should be modified weekly to provide a summary of the actions
// This should be modified weekly to provide a summary of the actions
// Hash: seth keccak -- "$(wget https://<executive-vote-canonical-post> -q -O - 2>/dev/null)"
// Hash: seth keccak -- "$(wget https://<executive-vote-canonical-post> -q -O - 2>/dev/null)"
function description() external view virtual returns (string memory);
function description() external view virtual returns (string memory);
// Returns the next available cast time
// Returns the next available cast time
function nextCastTime(uint256 eta) external view returns (uint256 castTime) {
function nextCastTime(uint256 eta) external view returns (uint256 castTime) {
require(eta <= type(uint40).max);
require(eta <= type(uint40).max);
castTime = DssExecLib.nextCastTime(uint40(eta), uint40(block.timestamp), officeHours());
castTime = DssExecLib.nextCastTime(uint40(eta), uint40(block.timestamp), officeHours());
}
}
}
}
////// lib/dss-exec-lib/src/DssExec.sol
//
// DssExec.sol -- MakerDAO Executive Spell Template
//
// Copyright (C) 2020-2022 Dai Foundation
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
/* pragma solidity ^0.8.16; */
Text moved to lines 63-134
interface PauseAbstract {
function delay() external view returns (uint256);
function plot(address, bytes32, bytes calldata, uint256) external;
function exec(address, bytes32, bytes calldata, uint256) external returns (bytes memory);
}
interface Changelog {
function getAddress(bytes32) external view returns (address);
}
interface SpellAction {
function officeHours() external view returns (bool);
function description() external view returns (string memory);
function nextCastTime(uint256) external view returns (uint256);
}
contract DssExec {
Changelog constant public log = Changelog(0xdA0Ab1e0017DEbCd72Be8599041a2aa3bA7e740F);
uint256 public eta;
bytes public sig;
bool public done;
bytes32 immutable public tag;
address immutable public action;
uint256 immutable public expiration;
PauseAbstract immutable public pause;
// Provides a descriptive tag for bot consumption
// This should be modified weekly to provide a summary of the actions
// Hash: seth keccak -- "$(wget https://<executive-vote-canonical-post> -q -O - 2>/dev/null)"
function description() external view returns (string memory) {
return SpellAction(action).description();
}
function officeHours() external view returns (bool) {
return SpellAction(action).officeHours();
}
function nextCastTime() external view returns (uint256 castTime) {
return SpellAction(action).nextCastTime(eta);
}
// @param _description A string description of the spell
// @param _expiration The timestamp this spell will expire. (Ex. block.timestamp + 30 days)
// @param _spellAction The address of the spell action
constructor(uint256 _expiration, address _spellAction) {
pause = PauseAbstract(log.getAddress("MCD_PAUSE"));
expiration = _expiration;
action = _spellAction;
sig = abi.encodeWithSignature("execute()");
bytes32 _tag; // Required for assembly access
address _action = _spellAction; // Required for assembly access
assembly { _tag := extcodehash(_action) }
tag = _tag;
}
function schedule() public {
require(block.timestamp <= expiration, "This contract has expired");
require(eta == 0, "This spell has already been scheduled");
eta = block.timestamp + PauseAbstract(pause).delay();
pause.plot(action, tag, sig, eta);
}
function cast() public {
require(!done, "spell-already-cast");
done = true;
pause.exec(action, tag, sig, eta);
}
}
////// lib/dss-test/lib/dss-interfaces/src/ERC/GemAbstract.sol
/* pragma solidity >=0.5.12; */
// A base ERC-20 abstract class
// https://eips.ethereum.org/EIPS/eip-20
interface GemAbstract {
function totalSupply() external view returns (uint256);
function balanceOf(address) external view returns (uint256);
function allowance(address, address) external view returns (uint256);
function approve(address, uint256) external returns (bool);
function transfer(address, uint256) external returns (bool);
function transferFrom(address, address, uint256) external returns (bool);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
////// lib/dss-test/lib/dss-interfaces/src/dss/VatAbstract.sol
/* pragma solidity >=0.5.12; */
Text moved to lines 148-180
// https://github.com/makerdao/dss/blob/master/src/vat.sol
interface VatAbstract {
function wards(address) external view returns (uint256);
function rely(address) external;
function deny(address) external;
function can(address, address) external view returns (uint256);
function hope(address) external;
function nope(address) external;
function ilks(bytes32) external view returns (uint256, uint256, uint256, uint256, uint256);
function urns(bytes32, address) external view returns (uint256, uint256);
function gem(bytes32, address) external view returns (uint256);
function dai(address) external view returns (uint256);
function sin(address) external view returns (uint256);
function debt() external view returns (uint256);
function vice() external view returns (uint256);
function Line() external view returns (uint256);
function live() external view returns (uint256);
function init(bytes32) external;
function file(bytes32, uint256) external;
function file(bytes32, bytes32, uint256) external;
function cage() external;
function slip(bytes32, address, int256) external;
function flux(bytes32, address, address, uint256) external;
function move(address, address, uint256) external;
function frob(bytes32, address, address, address, int256, int256) external;
function fork(bytes32, address, address, int256, int256) external;
function grab(bytes32, address, address, address, int256, int256) external;
function heal(uint256) external;
function suck(address, address, uint256) external;
function fold(bytes32, address, int256) external;
}
////// src/DssSpell.sol
// SPDX-FileCopyrightText: © 2020 Dai Foundation <www.daifoundation.org>
// SPDX-FileCopyrightText: © 2020 Dai Foundation <www.daifoundation.org>
//
//
// This program is free software: you can redistribute it and/or modify
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
// GNU Affero General Public License for more details.
//
//
// You should have received a copy of the GNU Affero General Public License
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// along with this program. If not, see <https://www.gnu.org/licenses/>.
/* pragma solidity 0.8.16; */
interface ProxyLike {
/* import "dss-exec-lib/DssExec.sol"; */
/* import "dss-exec-lib/DssAction.sol"; */
/* import { GemAbstract } from "dss-interfaces/ERC/GemAbstract.sol"; */
/* import { VatAbstract } from "dss-interfaces/dss/VatAbstract.sol"; */
interface ProxyLike_1 {
function exec(address target, bytes calldata args) external payable returns (bytes memory out);
function exec(address target, bytes calldata args) external payable returns (bytes memory out);
}
}
contract DssSpellAction is DssAction {
contract DssSpellAction is DssAction {
// Provides a descriptive tag for bot consumption
// Provides a descriptive tag for bot consumption
// This should be modified weekly to provide a summary of the actions
// This should be modified weekly to provide a summary of the actions
// Hash: cast keccak -- "$(wget 'https://raw.githubusercontent.com/makerdao/community/052330ed0eb8680dd9e4efaf92a4c056e46a4284/governance/votes/Executive%20vote%20-%20January%2024%2C%202024.md' -q -O - 2>/dev/null)"
// Hash: cast keccak -- "$(wget 'https://raw.githubusercontent.com/makerdao/community/052330ed0eb8680dd9e4efaf92a4c056e46a4284/governance/votes/Executive%20vote%20-%20January%2024%2C%202024.md' -q -O - 2>/dev/null)"
string public constant override description =
string public constant override description =
"2024-01-24 MakerDAO Executive Spell | Hash: 0x17cf7409b1ad2b06b8d3fdbe943ffc65ddc933b57674880c85b2a3d8168e1bf4";
"2024-01-24 MakerDAO Executive Spell | Hash: 0x17cf7409b1ad2b06b8d3fdbe943ffc65ddc933b57674880c85b2a3d8168e1bf4";
// Set office hours according to the summary
// Set office hours according to the summary
function officeHours() public pure override returns (bool) {
function officeHours() public pure override returns (bool) {
return true;
return true;
}
}
// ---------- Rates ----------
// ---------- Rates ----------
// Many of the settings that change weekly rely on the rate accumulator
// Many of the settings that change weekly rely on the rate accumulator
// described at https://docs.makerdao.com/smart-contract-modules/rates-module
// described at https://docs.makerdao.com/smart-contract-modules/rates-module
// To check this yourself, use the following rate calculation (example 8%):
// To check this yourself, use the following rate calculation (example 8%):
//
//
// $ bc -l <<< 'scale=27; e( l(1.08)/(60 * 60 * 24 * 365) )'
// $ bc -l <<< 'scale=27; e( l(1.08)/(60 * 60 * 24 * 365) )'
//
//
// A table of rates can be found at
// A table of rates can be found at
// https://ipfs.io/ipfs/QmVp4mhhbwWGTfbh2BzwQB9eiBrQBKiqcPRZCaAxNUaar6
// https://ipfs.io/ipfs/QmVp4mhhbwWGTfbh2BzwQB9eiBrQBKiqcPRZCaAxNUaar6
//
//
// uint256 internal constant X_PCT_RATE = ;
// uint256 internal constant X_PCT_RATE = ;
uint256 internal constant SIX_PT_FOUR_FIVE_PCT_RATE = 1000000001982027061559507021;
uint256 internal constant SIX_PT_FOUR_FIVE_PCT_RATE = 1000000001982027061559507021;
uint256 internal constant SIX_PT_FOUR_NINE_PCT_RATE = 1000000001993940198563273844;
uint256 internal constant SIX_PT_FOUR_NINE_PCT_RATE = 1000000001993940198563273844;
uint256 internal constant SIX_PT_SEVEN_PCT_RATE = 1000000002056410844314321266;
uint256 internal constant SIX_PT_SEVEN_PCT_RATE = 1000000002056410844314321266;
uint256 internal constant SIX_PT_SEVEN_FOUR_PCT_RATE = 1000000002068296073857195778;
uint256 internal constant SIX_PT_SEVEN_FOUR_PCT_RATE = 1000000002068296073857195778;
uint256 internal constant SIX_PT_NINE_ONE_PCT_RATE = 1000000002118758660201099744;
uint256 internal constant SIX_PT_NINE_ONE_PCT_RATE = 1000000002118758660201099744;
uint256 internal constant SEVEN_PT_ONE_SIX_PCT_RATE = 1000000002192822766493423465;
uint256 internal constant SEVEN_PT_ONE_SIX_PCT_RATE = 1000000002192822766493423465;
uint256 internal constant SEVEN_PT_TWO_PCT_RATE = 1000000002204656986467871801;
uint256 internal constant SEVEN_PT_TWO_PCT_RATE = 1000000002204656986467871801;
uint256 internal constant SEVEN_PT_TWO_FOUR_PCT_RATE = 1000000002216486791512316847;
uint256 internal constant SEVEN_PT_TWO_FOUR_PCT_RATE = 1000000002216486791512316847;
// ---------- Math ----------
// ---------- Math ----------
uint256 internal constant THOUSAND = 10 ** 3;
uint256 internal constant THOUSAND = 10 ** 3;
uint256 internal constant RAY = 10 ** 27;
uint256 internal constant RAY = 10 ** 27;
uint256 internal constant RAD = 10 ** 45;
uint256 internal constant RAD = 10 ** 45;
// ---------- Reduce PSM-PAX-A Debt Ceiling & Disable DC-IAM ----------
// ---------- Reduce PSM-PAX-A Debt Ceiling & Disable DC-IAM ----------
VatAbstract internal immutable vat = VatAbstract(DssExecLib.vat());
VatAbstract internal immutable vat = VatAbstract(DssExecLib.vat());
// ---------- RETH-A Offboarding Parameters Finalization ----------
// ---------- RETH-A Offboarding Parameters Finalization ----------
address internal immutable MCD_SPOT = DssExecLib.spotter();
address internal immutable MCD_SPOT = DssExecLib.spotter();
// ---------- SBE parameter changes ----------
// ---------- SBE parameter changes ----------
address internal immutable MCD_VOW = DssExecLib.vow();
address internal immutable MCD_VOW = DssExecLib.vow();
address internal immutable MCD_FLAP = DssExecLib.flap();
address internal immutable MCD_FLAP = DssExecLib.flap();
// ---------- Approve HV Bank (RWA009-A) DAO Resolution ----------
// ---------- Approve HV Bank (RWA009-A) DAO Resolution ----------
// Forum: https://forum.makerdao.com/t/huntingdon-valley-bank-transaction-documents-on-permaweb/16264/21
// Forum: https://forum.makerdao.com/t/huntingdon-valley-bank-transaction-documents-on-permaweb/16264/21
// Approve DAO resolution hash QmVtqkYtx61wEeM5Hb92dGA3TMZ9F1Z5WDSNwcszqxiF1w
// Approve DAO resolution hash QmVtqkYtx61wEeM5Hb92dGA3TMZ9F1Z5WDSNwcszqxiF1w
// Note: by the previous convention it should be a comma-separated list of DAO resolutions IPFS hashes
// Note: by the previous convention it should be a comma-separated list of DAO resolutions IPFS hashes
string public constant dao_resolutions = "QmVtqkYtx61wEeM5Hb92dGA3TMZ9F1Z5WDSNwcszqxiF1w";
string public constant dao_resolutions = "QmVtqkYtx61wEeM5Hb92dGA3TMZ9F1Z5WDSNwcszqxiF1w";
address internal constant RWA009_A_INPUT_CONDUIT_URN_USDC = 0x08012Ec53A7fAbf6F33318dfb93C1289886eBBE1;
address internal constant RWA009_A_INPUT_CONDUIT_URN_USDC = 0x08012Ec53A7fAbf6F33318dfb93C1289886eBBE1;
address internal immutable MCD_ESM = DssExecLib.esm();
address internal immutable MCD_ESM = DssExecLib.esm();
// ---------- AVC members compensation Q4 2023 ----------
// ---------- AVC members compensation Q4 2023 ----------
GemAbstract internal immutable MKR = GemAbstract(DssExecLib.mkr());
GemAbstract internal immutable MKR = GemAbstract(DssExecLib.mkr());
address internal constant IAMMEEOH = 0x47f7A5d8D27f259582097E1eE59a07a816982AE9;
address internal constant IAMMEEOH = 0x47f7A5d8D27f259582097E1eE59a07a816982AE9;
address internal constant DAI_VINCI = 0x9ee47F0f82F1A6F45C4E1D25Ce95C321D8C8356a;
address internal constant DAI_VINCI = 0x9ee47F0f82F1A6F45C4E1D25Ce95C321D8C8356a;
address internal constant OPENSKY_2 = 0xf44f97f4113759E0a57756bE49C0655d490Cf19F;
address internal constant OPENSKY_2 = 0xf44f97f4113759E0a57756bE49C0655d490Cf19F;
address internal constant ACREDAOS = 0xBF9226345F601150F64Ea4fEaAE7E40530763cbd;
address internal constant ACREDAOS = 0xBF9226345F601150F64Ea4fEaAE7E40530763cbd;
address internal constant FHOMONEYETH = 0xdbD5651F71ce83d1f0eD275aC456241890a53C74;
address internal constant FHOMONEYETH = 0xdbD5651F71ce83d1f0eD275aC456241890a53C74;
address internal constant RES = 0x8c5c8d76372954922400e4654AF7694e158AB784;
address internal constant RES = 0x8c5c8d76372954922400e4654AF7694e158AB784;
address internal constant HARMONY_2 = 0xE20A2e231215e9b7Aa308463F1A7490b2ECE55D3;
address internal constant HARMONY_2 = 0xE20A2e231215e9b7Aa308463F1A7490b2ECE55D3;
address internal constant LIBERTAS = 0xE1eBfFa01883EF2b4A9f59b587fFf1a5B44dbb2f;
address internal constant LIBERTAS = 0xE1eBfFa01883EF2b4A9f59b587fFf1a5B44dbb2f;
address internal constant SEEDLATAMETH = 0x0087a081a9B430fd8f688c6ac5dD24421BfB060D;
address internal constant SEEDLATAMETH = 0x0087a081a9B430fd8f688c6ac5dD24421BfB060D;
address internal constant ROOT = 0xC74392777443a11Dc26Ce8A3D934370514F38A91;
address internal constant ROOT = 0xC74392777443a11Dc26Ce8A3D934370514F38A91;
// ---------- Trigger Spark Proxy Spell ----------
// ---------- Trigger Spark Proxy Spell ----------
// Spark Proxy: https://github.com/marsfoundation/sparklend/blob/d42587ba36523dcff24a4c827dc29ab71cd0808b/script/output/1/primary-sce-latest.json#L2
// Spark Proxy: https://github.com/marsfoundation/sparklend/blob/d42587ba36523dcff24a4c827dc29ab71cd0808b/script/output/1/primary-sce-latest.json#L2
address internal constant SPARK_PROXY = 0x3300f198988e4C9C63F75dF86De36421f06af8c4;
address internal constant SPARK_PROXY = 0x3300f198988e4C9C63F75dF86De36421f06af8c4;
address internal constant SPARK_SPELL = 0xa3836fEF1D314d4c081C2707a7664c3375F29b61;
address internal constant SPARK_SPELL = 0xa3836fEF1D314d4c081C2707a7664c3375F29b61;
function actions() public override {
function actions() public override {
// ---------- Stability Fee Changes ----------
// ---------- Stability Fee Changes ----------
// Forum: https://forum.makerdao.com/t/stability-scope-parameter-changes-8/23445
// Forum: https://forum.makerdao.com/t/stability-scope-parameter-changes-8/23445
// Increase the ETH-A Stability Fee (SF) by 1.49%, from 5.25% to 6.74%.
// Increase the ETH-A Stability Fee (SF) by 1.49%, from 5.25% to 6.74%.
DssExecLib.setIlkStabilityFee("ETH-A", SIX_PT_SEVEN_FOUR_PCT_RATE, /* doDrip = */ true);
DssExecLib.setIlkStabilityFee("ETH-A", SIX_PT_SEVEN_FOUR_PCT_RATE, /* doDrip = */ true);
// Increase the ETH-B
// Increase the ETH-B Stability Fee (SF) by 1.49%, from 5.75% to 7.24%.
DssExecLib.setIlkStabilityFee("ETH-B", SEVEN_PT_TWO_FOUR_PCT_RATE, /* doDrip = */ true);
// Increase the ETH-C Stability Fee (SF) by 1.49%, from 5.00% to 6.49%.
DssExecLib.setIlkStabilityFee("ETH-C", SIX_PT_FOUR_NINE_PCT_RATE, /* doDrip = */ true);
// Increase the WSTETH-A Stability Fee (SF) by 1.91%, from 5.25% to 7.16%.
DssExecLib.setIlkStabilityFee("WSTETH-A", SEVEN_PT_ONE_SIX_PCT_RATE, /* doDrip = */ true);
// Increase the WSTETH-B Stability Fee (SF) by 1.91%, from 5.00% to 6.91%.
DssExecLib.setIlkStabilityFee("WSTETH-B", SIX_PT_NINE_ONE_PCT_RATE, /* doDrip = */ true);
// Increase the WBTC-A Stability Fee (SF) by 0.91%, from 5.79% to 6.70%.
DssExecLib.setIlkStabilityFee("WBTC-A", SIX_PT_SEVEN_PCT_RATE, /* doDrip = */ true);
// Increase the WBTC-B Stability Fee (SF) by 0.91%, from 6.29% to 7.20%.
DssExecLib.setIlkStabilityFee("WBTC-B", SEVEN_PT_TWO_PCT_RATE, /* doDrip = */ true);
// Increase the WBTC-C Stability Fee (SF) by 0.