-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
312 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
methods { | ||
function supply(Blue.Market, uint256 amount) external; | ||
function _.borrowRate(Blue.Market) external => DISPATCHER(true); | ||
|
||
|
||
function _.borrowRate(Blue.Market) external returns (uint256) => DISPATCH(true); | ||
|
||
function _.safeTransfer(address, uint256) internal returns (bool) envfree => DISPATCH(true); | ||
function _.safeTransferFrom(address, address, uint256) internal returns (bool) envfree => DISPATCH(true); | ||
function _.transfer(address, uint256) external => DISPATCHER(true); | ||
function _.transferFrom(address, address, uint256) external => DISPATCHER(true); | ||
} | ||
|
||
rule supplyRevertZero(Blue.Market market) { | ||
env e; | ||
|
||
supply@withrevert(market, 0); | ||
supply@withrevert(e, market, 0, e.msg.sender); | ||
|
||
assert lastReverted; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.0; | ||
|
||
import {IIrm} from "src/interfaces/IIrm.sol"; | ||
import {IERC20} from "src/interfaces/IERC20.sol"; | ||
import {IOracle} from "src/interfaces/IOracle.sol"; | ||
|
||
type Id is bytes32; | ||
|
||
struct Market { | ||
IERC20 borrowableAsset; | ||
IERC20 collateralAsset; | ||
IOracle borrowableOracle; | ||
IOracle collateralOracle; | ||
IIrm irm; | ||
uint256 lltv; | ||
} | ||
|
||
library MarketLib { | ||
function id(Market calldata market) internal pure returns (Id) { | ||
return Id.wrap(keccak256(abi.encode(market))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.