Skip to content

Commit

Permalink
Trust metamorpho mitigations (#1129)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrent authored May 6, 2024
1 parent 9f74dd5 commit 71cef57
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 16 deletions.
4 changes: 0 additions & 4 deletions contracts/plugins/assets/ERC4626FiatCollateral.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ contract ERC4626FiatCollateral is AppreciatingFiatCollateral {
constructor(CollateralConfig memory config, uint192 revenueHiding)
AppreciatingFiatCollateral(config, revenueHiding)
{
require(address(config.erc20) != address(0), "missing erc20");
if (config.defaultThreshold != 0) {
require(config.delayUntilDefault != 0, "delayUntilDefault zero");
}
IERC4626 vault = IERC4626(address(config.erc20));
oneShare = 10**vault.decimals();
refDecimals = int8(uint8(IERC20Metadata(vault.asset()).decimals()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ERC4626FiatCollateral } from "../ERC4626FiatCollateral.sol";
/**
* @title MetaMorphoSelfReferentialCollateral
* @notice Collateral plugin for a MetaMorpho vault with self referential collateral, like WETH
* Expected: {tok} == {ref}, {ref} == {target}, {target} != {UoA}
* Expected: {tok} != {ref}, {ref} == {target}, {target} != {UoA}
*
* For example: Re7WETH
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { shiftl_toFix, FIX_ONE, FixLib, CEIL } from "../../../libraries/Fixed.so
/**
* @title MorphoSelfReferentialCollateral
* @notice Collateral plugin for a Morpho pool with self referential collateral, like WETH
* Expected: {tok} == {ref}, {ref} == {target}, {target} != {UoA}
* Expected: {tok} != {ref}, {ref} == {target}, {target} != {UoA}
*/
contract MorphoSelfReferentialCollateral is AppreciatingFiatCollateral {
using OracleLib for AggregatorV3Interface;
Expand Down
8 changes: 4 additions & 4 deletions scripts/addresses/mainnet-3.4.0/1-tmp-assets-collateral.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@
"sFRAX": "0x0b7DcCBceA6f985301506D575E2661bf858CdEcC",
"saEthUSDC": "0x00F820794Bda3fb01E5f159ee1fF7c8409fca5AB",
"saEthPyUSD": "0x58a41c87f8C65cf21f961b570540b176e408Cf2E",
"bbUSDT": "0x3017d881724D93783e7f065Cc5F62c81C62c36A0",
"steakUSDC": "0x4895b9aee383b5dec499F54172Ccc7Ee05FC8Bbc",
"steakPYUSD": "0xBd01C789Be742688fb73F6aE46f1320196B6c973",
"Re7WETH": "0x3421d2cB19c8E69c6FA642C43e60cD943e75Ca8b",
"bbUSDT": "0x01355C7439982c57cF89CA9785d211806f866224",
"steakUSDC": "0x565CBc99EE04667581c7f3459561fCaf1CF68602",
"steakPYUSD": "0x23f06D5Fe858B18CD064A5D95054e8ae8536094a",
"Re7WETH": "0xa0a6C06e45437d4Ae1D778AaeB4605AC2B62A870",
"cvxCrvUSDUSDC": "0x9Fc0F31e2D26C437461a9eEBfe858d17e2611Ea5",
"cvxCrvUSDUSDT": "0x69c6597690B8Df61D15F201519C03725bdec40c1",
"sfrxETH": "0x4c891fCa6319d492866672E3D2AfdAAA5bDcfF67"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async function main() {
defaultThreshold: USDT_ORACLE_ERROR.add(fp('0.01')).toString(), // +1% buffer rule
delayUntilDefault: DELAY_UNTIL_DEFAULT.toString(),
},
fp('1e-6') // small admin fee uncertainty
fp('1e-4') // can have small drawdowns
)
await collateral.deployed()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async function main() {
defaultThreshold: '0', // WETH
delayUntilDefault: DELAY_UNTIL_DEFAULT.toString(),
},
fp('1e-6') // small admin fee uncertainty
fp('1e-3') // can have large drawdowns
)
)
await collateral.deployed()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async function main() {
defaultThreshold: PYUSD_ORACLE_ERROR.add(fp('0.01')).toString(), // +1% buffer rule
delayUntilDefault: DELAY_UNTIL_DEFAULT.toString(),
},
fp('1e-6') // small admin fee uncertainty
fp('1e-4') // can have small drawdowns
)
await collateral.deployed()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async function main() {
defaultThreshold: USDC_ORACLE_ERROR.add(fp('0.01')).toString(), // +1% buffer rule
delayUntilDefault: DELAY_UNTIL_DEFAULT.toString(),
},
fp('1e-6') // small admin fee uncertainty
fp('1e-4') // can have mild drawdowns
)
await collateral.deployed()

Expand Down
2 changes: 1 addition & 1 deletion scripts/verification/collateral-plugins/verify_re7weth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async function main() {
defaultThreshold: '0', // WETH
delayUntilDefault: DELAY_UNTIL_DEFAULT.toString(),
},
fp('1e-6'), // small admin fee uncertainty
fp('1e-3'), // can have large drawdowns
],
'contracts/plugins/assets/meta-morpho/MetaMorphoSelfReferentialCollateral.sol:MetaMorphoSelfReferentialCollateral'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async function main() {
defaultThreshold: USDC_ORACLE_ERROR.add(fp('0.01')).toString(), // +1% buffer rule
delayUntilDefault: DELAY_UNTIL_DEFAULT.toString(),
},
fp('1e-6'), // small admin fee uncertainty
fp('1e-4'), // can have small drawdowns
],
'contracts/plugins/assets/meta-morpho/MetaMorphoFiatCollateral.sol:MetaMorphoFiatCollateral'
)
Expand Down

0 comments on commit 71cef57

Please sign in to comment.