|
20 | 20 | pragma solidity ^0.6.11;
|
21 | 21 |
|
22 | 22 | import "./CollateralOpts.sol";
|
23 |
| -import { DssExecLib as lib, OracleLike } from "./DssExecLib.sol"; |
| 23 | +import { DssExecLib } from "./DssExecLib.sol"; |
| 24 | + |
| 25 | +interface OracleLike { |
| 26 | + function src() external view returns (address); |
| 27 | +} |
24 | 28 |
|
25 | 29 | abstract contract DssAction {
|
26 | 30 |
|
27 |
| - using lib for *; |
| 31 | + using DssExecLib for *; |
28 | 32 |
|
29 | 33 | // Office Hours defaults to true by default.
|
30 | 34 | // To disable office hours, override this function and
|
@@ -61,52 +65,52 @@ abstract contract DssAction {
|
61 | 65 | // Complete collateral onboarding logic.
|
62 | 66 | function addNewCollateral(CollateralOpts memory co) internal {
|
63 | 67 | // Add the collateral to the system.
|
64 |
| - lib.addCollateralBase(co.ilk, co.gem, co.join, co.flip, co.pip); |
| 68 | + DssExecLib.addCollateralBase(co.ilk, co.gem, co.join, co.flip, co.pip); |
65 | 69 |
|
66 | 70 | // Allow FlipperMom to access to the ilk Flipper
|
67 |
| - address _flipperMom = lib.flipperMom(); |
68 |
| - lib.authorize(co.flip, _flipperMom); |
| 71 | + address _flipperMom = DssExecLib.flipperMom(); |
| 72 | + DssExecLib.authorize(co.flip, _flipperMom); |
69 | 73 | // Disallow Cat to kick auctions in ilk Flipper
|
70 |
| - if(!co.isLiquidatable) { lib.deauthorize(_flipperMom, co.flip); } |
| 74 | + if(!co.isLiquidatable) { DssExecLib.deauthorize(_flipperMom, co.flip); } |
71 | 75 |
|
72 | 76 | if(co.isOSM) { // If pip == OSM
|
73 | 77 | // Allow OsmMom to access to the TOKEN OSM
|
74 |
| - lib.authorize(co.pip, lib.osmMom()); |
| 78 | + DssExecLib.authorize(co.pip, DssExecLib.osmMom()); |
75 | 79 | if (co.whitelistOSM) { // If median is src in OSM
|
76 | 80 | // Whitelist OSM to read the Median data (only necessary if it is the first time the token is being added to an ilk)
|
77 |
| - lib.addReaderToMedianWhitelist(address(OracleLike(co.pip).src()), co.pip); |
| 81 | + DssExecLib.addReaderToMedianWhitelist(address(OracleLike(co.pip).src()), co.pip); |
78 | 82 | }
|
79 | 83 | // Whitelist Spotter to read the OSM data (only necessary if it is the first time the token is being added to an ilk)
|
80 |
| - lib.addReaderToOSMWhitelist(co.pip, lib.spotter()); |
| 84 | + DssExecLib.addReaderToOSMWhitelist(co.pip, DssExecLib.spotter()); |
81 | 85 | // Whitelist End to read the OSM data (only necessary if it is the first time the token is being added to an ilk)
|
82 |
| - lib.addReaderToOSMWhitelist(co.pip, lib.end()); |
| 86 | + DssExecLib.addReaderToOSMWhitelist(co.pip, DssExecLib.end()); |
83 | 87 | // Set TOKEN OSM in the OsmMom for new ilk
|
84 |
| - lib.allowOSMFreeze(co.pip, co.ilk); |
| 88 | + DssExecLib.allowOSMFreeze(co.pip, co.ilk); |
85 | 89 | }
|
86 | 90 | // Increase the global debt ceiling by the ilk ceiling
|
87 |
| - lib.increaseGlobalDebtCeiling(co.ilkDebtCeiling); |
| 91 | + DssExecLib.increaseGlobalDebtCeiling(co.ilkDebtCeiling); |
88 | 92 | // Set the ilk debt ceiling
|
89 |
| - lib.setIlkDebtCeiling(co.ilk, co.ilkDebtCeiling); |
| 93 | + DssExecLib.setIlkDebtCeiling(co.ilk, co.ilkDebtCeiling); |
90 | 94 | // Set the ilk dust
|
91 |
| - lib.setIlkMinVaultAmount(co.ilk, co.minVaultAmount); |
| 95 | + DssExecLib.setIlkMinVaultAmount(co.ilk, co.minVaultAmount); |
92 | 96 | // Set the dunk size
|
93 |
| - lib.setIlkMaxLiquidationAmount(co.ilk, co.maxLiquidationAmount); |
| 97 | + DssExecLib.setIlkMaxLiquidationAmount(co.ilk, co.maxLiquidationAmount); |
94 | 98 | // Set the ilk liquidation penalty
|
95 |
| - lib.setIlkLiquidationPenalty(co.ilk, co.liquidationPenalty); |
| 99 | + DssExecLib.setIlkLiquidationPenalty(co.ilk, co.liquidationPenalty); |
96 | 100 |
|
97 | 101 | // Set the ilk stability fee
|
98 |
| - lib.setIlkStabilityFee(co.ilk, co.ilkStabilityFee, true); |
| 102 | + DssExecLib.setIlkStabilityFee(co.ilk, co.ilkStabilityFee, true); |
99 | 103 |
|
100 | 104 | // Set the ilk percentage between bids
|
101 |
| - lib.setIlkMinAuctionBidIncrease(co.ilk, co.bidIncrease); |
| 105 | + DssExecLib.setIlkMinAuctionBidIncrease(co.ilk, co.bidIncrease); |
102 | 106 | // Set the ilk time max time between bids
|
103 |
| - lib.setIlkBidDuration(co.ilk, co.bidDuration); |
| 107 | + DssExecLib.setIlkBidDuration(co.ilk, co.bidDuration); |
104 | 108 | // Set the ilk max auction duration
|
105 |
| - lib.setIlkAuctionDuration(co.ilk, co.auctionDuration); |
| 109 | + DssExecLib.setIlkAuctionDuration(co.ilk, co.auctionDuration); |
106 | 110 | // Set the ilk min collateralization ratio
|
107 |
| - lib.setIlkLiquidationRatio(co.ilk, co.liquidationRatio); |
| 111 | + DssExecLib.setIlkLiquidationRatio(co.ilk, co.liquidationRatio); |
108 | 112 |
|
109 | 113 | // Update ilk spot value in Vat
|
110 |
| - lib.updateCollateralPrice(co.ilk); |
| 114 | + DssExecLib.updateCollateralPrice(co.ilk); |
111 | 115 | }
|
112 | 116 | }
|
0 commit comments