Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
e15262e
chore: update dependencies
amusingaxl Apr 25, 2025
2673fad
refactor: remove custom test script in favor of `forge test`
amusingaxl Apr 25, 2025
ecd7f5e
chore: add .editorconfig
amusingaxl Apr 25, 2025
449744a
refactor: rename D3M functions to DDM
amusingaxl Apr 28, 2025
b4c53d7
refactor: improve formatting
amusingaxl Apr 28, 2025
a3ed6f0
refactor: replace old Flap actions with FlapUniV2 ones
amusingaxl Apr 28, 2025
07d695a
refactor: change comment style to reduce the total number of lines
amusingaxl Apr 28, 2025
323146e
feat: add USDS support
amusingaxl Apr 28, 2025
a1cce89
feat: add SUSDS and USDS support
amusingaxl Apr 28, 2025
105721c
refactor: improve docs and interface names
amusingaxl May 6, 2025
29d9946
refactor: generalize `addReaderToWhitelist`
amusingaxl May 6, 2025
982c9ea
docs: improve README
amusingaxl May 6, 2025
6d6f468
feat: add `setGSMDelay`
amusingaxl May 6, 2025
74539b6
docs: update headers and natspec
amusingaxl May 6, 2025
a04ae9f
refactor: implement changes related to the `Chief` migration
amusingaxl May 6, 2025
c066aa7
chore: apply default `forge fmt` to all contracts
amusingaxl May 6, 2025
99797f0
fix: `test_setGSMDelay` to call `MCD_PAUSE_PROXY`
amusingaxl May 6, 2025
f3e50f3
chore: fix comment section header formatting
amusingaxl May 6, 2025
aa3c928
fix: update natspec and parameter names for generalized whitelist man…
amusingaxl May 7, 2025
cff0591
chore: improve natspec and section comment formatting
amusingaxl May 7, 2025
abb4ae2
chore: ensure docs and comments use Sky Protocol rather than MakerDAO…
amusingaxl May 7, 2025
db76337
chore: remove Makefile, as default `forge` commands are preferred.
amusingaxl May 7, 2025
01938d5
fix: remove duplicate ETH_RPC_URL setting in GitHub workflow
amusingaxl May 7, 2025
4ab7c38
Apply suggestions from code review
amusingaxl May 13, 2025
be45903
refactor: simplify further oracle management
amusingaxl May 16, 2025
448c551
feat: add `removeChangelogAddress`
amusingaxl May 16, 2025
b6e7597
feat: add Star spell proxy execution functions
amusingaxl May 16, 2025
9f0aac8
refacotr: reorganize project structure
amusingaxl May 16, 2025
30404c3
docs: update documntation about `checkWhitelistedOSM`
amusingaxl May 19, 2025
d7fdb6b
chore: format README
amusingaxl May 19, 2025
391e29f
docs: update README with TODO for the new release
amusingaxl May 19, 2025
f8e045a
fix: typo in READMEw
amusingaxl May 19, 2025
925f6e6
docs: add missing documentation to README
amusingaxl May 19, 2025
62fe567
refactor: rename auction debt related functions
amusingaxl May 19, 2025
37d3da9
refactor: remove MCD_CAT related functions
amusingaxl May 19, 2025
4b2ec84
refactor: rename setMaxTotalDAILiquidationAmount to setMaxTotalDebtLi…
amusingaxl May 19, 2025
bce0f81
refactor: rename setDAIReferenceValue to setParity
amusingaxl May 19, 2025
50102af
refactor: remove specific DAI references from function documentation
amusingaxl May 19, 2025
88608c9
chore: fix formatting
amusingaxl May 19, 2025
2fac7bf
feat: add overloaded setIlkAutoLineParameters function
amusingaxl May 19, 2025
c2d8e0d
refactor: update DssExecTest to work with the new Chief
amusingaxl May 19, 2025
3a88510
refactor: clean up `DssActionTest`
amusingaxl May 19, 2025
da2d9b7
Apply suggestions from code review
amusingaxl Jun 11, 2025
d5b0281
fix: apply suggestions from code review
amusingaxl Jul 23, 2025
aa7c852
refactor: add changes related to SKY being the new governance token
amusingaxl Jul 23, 2025
1b0dedb
refactor: remove `flipperMom` getter
amusingaxl Sep 10, 2025
e94ec06
refactor: remove mkrGuard in favor of govGuard for SKY only
amusingaxl Sep 12, 2025
c3f4a34
refactor: add sanity check for `setAutoLineIlkParameters(ilk, amount,…
amusingaxl Sep 12, 2025
a292163
docs: improve NatSpec
amusingaxl Sep 12, 2025
110f73e
docs: improve README
amusingaxl Sep 12, 2025
d1c738d
Merge branch 'master' into audit-feedback/revamp-for-chief-migration
amusingaxl Sep 12, 2025
3996d70
refactor: fix tests
amusingaxl Sep 12, 2025
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
31 changes: 22 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ Below is an outline of all functions used in the library.
- `pot()`: Savings Rates Module
- `vow()`: System Stabilizer Module
- `end()`: Shutdown Coordinator
- `esm()`: Emergency Shutdown Module
- `reg()`: Ilk Registry
- `spotter()`: Oracle Liason
- `flap()`: Surplus Auction Module
- `flop()`: Debt Auction Module
- `osmMom()`: OSM Circuit Breaker
- `govGuard()`: MKR Authority
- `flipperMom()`: Flipper Governance Interface
- `govGuard()`: SKY Authority
- `clipperMom()`: Clipper Governance Interface (Liquidations 2.0)
- `pauseProxy()`: Governance Authority
- `autoLine()`: Debt Ceiling Auto Adjustment
Expand Down Expand Up @@ -135,6 +135,8 @@ Below is an outline of all functions used in the library.

- `setContract(address _base, bytes32 _what, address _addr)`: Set a contract in another contract, defining the relationship (ex. set a new Vow contract in the Dog)
- `setContract(address _base, bytes32 _ilk, bytes32 _what, address _addr)`: Set a contract in another contract, defining the relationship for a given ilk.
- `setValue(address _base, bytes32 _what, uint256 _amt)`: Set a value in a contract via a governance authorized File pattern.
- `setValue(address _base, bytes32 _ilk, bytes32 _what, uint256 _amt)`: Set an ilk-specific value in a contract via a governance authorized File pattern.

### System Risk Parameters

Expand All @@ -144,7 +146,7 @@ Below is an outline of all functions used in the library.
- `setDSR(uint256 _rate, bool _doDrip)`: Set the Dai Savings Rate.
- `setSSR(uint256 _rate, bool _doDrip)`: Set the Sky Savings Rate.
- `setSurplusAuctionAmount(uint256 _amount)`: Set the amount for system surplus auctions.
- `setSurplusAuctionMinPriceThreshold(uint256 _pct_bps)`: Set the relative multiplier of the reference price to insist in the swap. For example, `9_80` bps allows a 2% drop in the reference price.
- `setSurplusAuctionMinPriceThreshold(uint256 _pct_bps)`: Set the relative multiplier of the reference price to insist in the swap. For example, `98_00` bps allows a 2% drop in the reference price.
- `setSurplusBuffer(uint256 _amount)`: Set the amount for system surplus buffer, must be exceeded before surplus auctions start.
- `setDebtAuctionDelay(uint256 _length)`: Set the number of seconds that pass before system debt is auctioned for MKR tokens.
- `setDebtAuctionDebtAmount(uint256 _amount)`: Set the debt amount for system debt to be covered by each debt auction.
Expand Down Expand Up @@ -182,9 +184,9 @@ Below is an outline of all functions used in the library.

### Abacus Management

- `initLinearDecrease(address _calc, uint256 _duration)`: Initialize the variables in a LinearDecrease calculator.
- `initStairstepExponentialDecrease(address _calc, uint256 _duration, uint256 _pct_bps)`: Initialize the variables in a StairstepExponentialDecrease calculator.
- `initExponentialDecrease(address _calc, uint256 _pct_bps)`: Initialize the variables in an ExponentialDecrease calculator.
- `setLinearDecrease(address _calc, uint256 _duration)`: Set the variables in a LinearDecrease calculator.
- `setStairstepExponentialDecrease(address _calc, uint256 _duration, uint256 _pct_bps)`: Set the variables in a StairstepExponentialDecrease calculator.
- `setExponentialDecrease(address _calc, uint256 _pct_bps)`: Set the variables in an ExponentialDecrease calculator.

### Oracle Management

Expand Down Expand Up @@ -227,9 +229,9 @@ Once these actions are done, add the following code (below is an example) to the
```solidity
import "src/CollateralOpts.sol";

// Initialize the pricing function with the appropriate initializer
// Set the pricing function with the appropriate setter
address xmpl_calc = 0x1f206d7916Fd3B1b5B0Ce53d5Cab11FCebc124DA;
DssExecLib.initStairstepExponentialDecrease(xmpl_calc, 60, 9900);
DssExecLib.setStairstepExponentialDecrease(xmpl_calc, 60, 9900);

CollateralOpts memory XMPL_A = CollateralOpts({
ilk: "XMPL-A",
Expand All @@ -246,9 +248,12 @@ CollateralOpts memory XMPL_A = CollateralOpts({
liquidationPenalty: 1300, // 13% penalty
ilkStabilityFee: 1000000000705562181084137268,
startingPriceFactor: 13000, // 1.3x multiplier
breakerTolerance: 9500, // 95% price tolerance
auctionDuration: 6 hours,
permittedDrop: 4000, // 40% drop before reset
liquidationRatio: 15000 // 150% collateralization ratio
liquidationRatio: 15000, // 150% collateralization ratio
kprFlatReward: 300, // 300 Dai flat reward
kprPctReward: 10 // 0.1% percentage reward
});

DssExecLib.addNewCollateral(XMPL_A);
Expand All @@ -275,14 +280,22 @@ DssExecLib.setChangelogAddress("MCD_CLIP_CALC_XMPL-A", xmpl_calc);
- `liquidationPenalty`: Percent liquidation penalty for new collateral [ex. 13.5% == 1350]
- `ilkStabilityFee`: Percent stability fee for new collateral [ex. 4% == 1000000001243680656318820312]
- `startingPriceFactor`: Percentage to multiply for initial auction price. [ex. 1.3x == 130% == 13000 bps]
- `breakerTolerance`: Percentage tolerance for liquidation circuit breaker [ex. 95% == 9500 bps]
- `auctionDuration`: Total auction duration before reset for new collateral
- `permittedDrop`: Percent an auction can drop before it can be reset.
- `liquidationRatio`: Percent liquidation ratio for new collateral [ex. 150% == 15000]
- `kprFlatReward`: Flat DAI reward paid to keepers for liquidation actions [ex. 300 DAI == 300]
- `kprPctReward`: Percentage of liquidation amount paid to keepers [ex. 0.1% == 10 bps]

### Payments

- `sendPaymentFromSurplusBuffer(address _join, address _target, uint256 _amount)`: Send a payment in either ERC20 USDS or DAI from the surplus buffer.

### SubDAO/Star Spells

- `executeStarSpell(address _starProxy, address _starSpell)`: Execute a star spell through its star proxy. Returns the return data from the spell execution.
- `tryExecuteStarSpell(address _starProxy, address _starSpell)`: Tries to execute a star spell through its star proxy using low-level call to avoid reverts in case of error. Returns a boolean indicating success and the return data or error message.

### Misc

- `function linearInterpolation(bytes32 _name, address _target, bytes32 _what, uint256 _startTime, uint256 _start, uint256 _end, uint256 _duration)`: Deploys a new general lerp contract with the associated parameters and returns the `address` of the contract.
Expand Down
5 changes: 5 additions & 0 deletions src/DssAction.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,11 @@ contract DssActionTest is Test {
assertEq(uint256(ttl), initialTtl); // ttl should remain unchanged
}

function test_RevertSetIlkAutoLineParametersKeepTtl_WhenNotConfigured() public {
vm.expectRevert();
action.setIlkAutoLineParameters_test("gold", 200 * MILLION, 10 * MILLION);
}

function test_setIlkAutoLineDebtCeiling() public {
action.setIlkAutoLineParameters_test("gold", 1, 5 * MILLION, 10000); // gap and ttl must be configured already
action.setIlkAutoLineDebtCeiling_test("gold", 150 * MILLION); // Setup
Expand Down
24 changes: 12 additions & 12 deletions src/DssExec.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ contract DssLibSpellAction is

DssExecLib.addNewCollateral(XMPL_A);

DssExecLib.setIlkDebtCeiling("LINK-A", 10 * MILLION);
DssExecLib.setIlkMinVaultAmount("LINK-A", 800);
DssExecLib.setIlkLiquidationRatio("LINK-A", 16000);
DssExecLib.setIlkLiquidationPenalty("LINK-A", 1400);
DssExecLib.setIlkMaxLiquidationAmount("LINK-A", 100000);
DssExecLib.setAuctionTimeBeforeReset("LINK-A", 2 hours);
DssExecLib.setKeeperIncentivePercent("LINK-A", 2); // 0.02% keeper incentive
DssExecLib.setIlkDebtCeiling("ETH-A", 10 * MILLION);
DssExecLib.setIlkMinVaultAmount("ETH-A", 800);
DssExecLib.setIlkLiquidationRatio("ETH-A", 16000);
DssExecLib.setIlkLiquidationPenalty("ETH-A", 1400);
DssExecLib.setIlkMaxLiquidationAmount("ETH-A", 100000);
DssExecLib.setAuctionTimeBeforeReset("ETH-A", 2 hours);
DssExecLib.setKeeperIncentivePercent("ETH-A", 2); // 0.02% keeper incentive
DssExecLib.setGlobalDebtCeiling(10000 * MILLION);
}
}
Expand Down Expand Up @@ -214,7 +214,7 @@ contract DssExecTest is Test {
osmMom = OsmMomAbstract(LOG.getAddress("OSM_MOM"));
clipMom = ClipperMomAbstract(LOG.getAddress("CLIPPER_MOM"));
xmpl = GemAbstract(0xCE4F3774620764Ea881a8F8840Cbe0F701372283);
pipXMPL = OsmAbstract(LOG.getAddress("PIP_USDT"));
pipXMPL = OsmAbstract(LOG.getAddress("PIP_ETH"));

rates = new MockRates();

Expand All @@ -237,10 +237,10 @@ contract DssExecTest is Test {
afterSpell.ilk_count = reg.count() + 1; // Num expected in system

// Test for all collateral based changes here
(uint256 _duty,) = jug.ilks("LINK-A");
(address _clip,,,) = dog.ilks("LINK-A");
(uint256 _duty,) = jug.ilks("ETH-A");
(address _clip,,,) = dog.ilks("ETH-A");
ClipAbstract clip = ClipAbstract(_clip);
afterSpell.collaterals["LINK-A"] = CollateralValues({
afterSpell.collaterals["ETH-A"] = CollateralValues({
line: 10 * MILLION, // In whole Dai units
dust: 800, // In whole Dai units
pct: _duty, // In basis points
Expand Down Expand Up @@ -579,7 +579,7 @@ contract DssExecTest is Test {
assertTrue(spell.done());

checkSystemValues(afterSpell);
checkCollateralValues("LINK-A", afterSpell);
checkCollateralValues("ETH-A", afterSpell);
checkCollateralValues("XMPL-A", afterSpell);

assertTrue(spell.officeHours());
Expand Down
Loading