mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
updated setUint
This commit is contained in:
parent
e56ca991e7
commit
60169ee5ee
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.7.0;
|
||||
|
||||
contract Events {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
|
||||
pragma solidity ^0.7.0;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
|
@ -100,4 +99,8 @@ contract Helpers is DSMath, Basic {
|
|||
address(this)
|
||||
);
|
||||
}
|
||||
|
||||
function _balance(address token1, address token2) internal view returns (uint balance) {
|
||||
balance = IERC20(token1).balanceOf(address(this)) + IERC20(token2).balanceOf(address(this));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.7.0;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.7.0;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
|
@ -198,10 +199,12 @@ abstract contract SushipswapIncentiveResolver is Helpers, Events {
|
|||
if (data.poolId == uint256(-1) || data.version == 0) {
|
||||
data = _getPoolId(token1, token2);
|
||||
}
|
||||
setUint(setId, data.poolId);
|
||||
uint256 currentBal = _balance(token1, token2);
|
||||
require(data.poolId != uint256(-1), "pool-does-not-exist");
|
||||
(uint256 lpAmount, uint256 rewardsAmount) = _getUserInfo(data);
|
||||
_emergencyWithdraw(data);
|
||||
uint256 finalBal = _balance(token1, token2);
|
||||
setUint(setId, uint256(currentBal - finalBal));
|
||||
_eventName = "LogEmergencyWithdraw(address,address,uint256,uint256,uint256,uint256)";
|
||||
_eventParam = abi.encode(
|
||||
token1,
|
||||
|
|
Loading…
Reference in New Issue
Block a user