yield-contract/contracts/logics/settle/eth/maxComp.sol

28 lines
1.1 KiB
Solidity
Raw Normal View History

2020-09-10 07:14:06 +00:00
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.8;
2020-09-10 13:02:47 +00:00
pragma experimental ABIEncoderV2;
2020-09-10 07:14:06 +00:00
import { DSMath } from "../../../libs/safeMath.sol";
2020-09-10 13:02:47 +00:00
interface DSAInterface {
function cast(address[] calldata _targets, bytes[] calldata _datas, address _origin) external payable;
}
2020-09-10 07:14:06 +00:00
contract LogicOne {
2020-09-12 13:22:28 +00:00
function maxComp(address _dsa, address[] calldata _targets, bytes[] calldata _data) public {
// check if DSA is authorised for interaction
2020-09-12 13:29:12 +00:00
// Also think on dydx flash loan connector
address compoundConnector = address(0); // Check9898 - address of compound connector
address instaPoolConnector = address(0); // Check9898 - address of instaPool connector
2020-09-10 13:02:47 +00:00
for (uint i = 0; i < _targets.length; i++) {
require(_targets[i] == compoundConnector || _targets[i] == instaPoolConnector, "connector-not-authorised");
}
2020-09-12 13:29:12 +00:00
DSAInterface(_dsa).cast(_targets, _data, address(0)); // Check9898 - address of basic connector
2020-09-10 07:14:06 +00:00
// check if status is safe and only have assets in the specific tokens
}
receive() external payable {}
}