mirror of
https://github.com/Instadapp/yield-contract.git
synced 2024-07-29 21:47:29 +00:00
Minor changes to basic.sol settle logic
This commit is contained in:
parent
349f3496db
commit
ebfb2b7a03
|
@ -9,6 +9,7 @@ import { DSMath } from "../../../libs/safeMath.sol";
|
|||
|
||||
interface DSAInterface {
|
||||
function cast(address[] calldata _targets, bytes[] calldata _data, address _origin) external payable;
|
||||
function isAuth(address) external returns(bool);
|
||||
}
|
||||
|
||||
contract LogicOne {
|
||||
|
@ -27,7 +28,7 @@ contract LogicOne {
|
|||
}
|
||||
|
||||
function deploy(address _dsa, address _token, uint amt) public {
|
||||
// check if DSA is authorised
|
||||
require(DSAInterface(_dsa).isAuth(address(this)), "pool-not-auth-in-dsa");
|
||||
if (_token == getEthAddr()) {
|
||||
uint _bal = address(this).balance;
|
||||
amt = amt > _bal ? _bal : amt;
|
||||
|
@ -51,9 +52,4 @@ contract LogicOne {
|
|||
_data[0] = abi.encodeWithSignature("withdraw(address,uint256,address,uint256,uint256)", _token, amt, address(this), uint(0), uint(0));
|
||||
DSAInterface(_dsa).cast(_targets, _data, getOriginAddress());
|
||||
}
|
||||
|
||||
constructor () public {}
|
||||
|
||||
receive() external payable {}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user