mirror of
https://github.com/Instadapp/dsa-connectors-old.git
synced 2024-07-29 22:47:46 +00:00
Minor changes
This commit is contained in:
parent
ea52262f2f
commit
0f33852c24
|
@ -10,6 +10,7 @@ interface IStakingRewards {
|
|||
function exit() external;
|
||||
function withdraw(uint256 amount) external;
|
||||
function getReward() external;
|
||||
function balanceOf(address) external returns (uint256);
|
||||
}
|
||||
|
||||
contract SynthetixStakingHelper is DSMath, Stores {
|
||||
|
@ -103,14 +104,11 @@ contract SynthetixStaking is SynthetixStakingHelper {
|
|||
uint _amt = getUint(getId, amt);
|
||||
IStakingRewards stakingContract = IStakingRewards(getSynthetixStakingAddr(token));
|
||||
TokenInterface snxToken = TokenInterface(getSnxAddr());
|
||||
_amt = _amt == uint(-1) ? stakingContract.balanceOf(address(this)) : _amt;
|
||||
|
||||
uint intialBal = snxToken.balanceOf(address(this));
|
||||
if (_amt == uint(-1)) {
|
||||
stakingContract.exit();
|
||||
} else{
|
||||
stakingContract.withdraw(_amt);
|
||||
stakingContract.getReward();
|
||||
}
|
||||
stakingContract.withdraw(_amt);
|
||||
stakingContract.getReward();
|
||||
uint finalBal = snxToken.balanceOf(address(this));
|
||||
|
||||
uint rewardAmt = sub(finalBal, intialBal);
|
||||
|
|
Loading…
Reference in New Issue
Block a user