adding totalSupply for staked and token

This commit is contained in:
Lecky Lao 2020-07-19 22:22:00 +10:00
parent b91bdda63b
commit 1f7e2984dd

View File

@ -9,6 +9,7 @@ interface TokenInterface {
interface IStakingRewards { interface IStakingRewards {
function balanceOf(address) external view returns (uint256); function balanceOf(address) external view returns (uint256);
function totalSupply() external view returns (uint256) {
function earned(address) external view returns (uint256); function earned(address) external view returns (uint256);
} }
@ -36,14 +37,18 @@ contract Resolver is CurveStakingHelpers {
function getPosition(address user, string memory stakingPoolName) public view returns ( function getPosition(address user, string memory stakingPoolName) public view returns (
uint stakedBal, uint stakedBal,
uint stakedTotalSupply,
uint rewardsEarned, uint rewardsEarned,
uint tokenBal uint tokenBal,
uint tokenTotalSupply
) { ) {
Staking staking = Staking(getStakingAddr()); Staking staking = Staking(getStakingAddr());
(IStakingRewards stakingContract, TokenInterface stakingToken, bytes32 stakingType) = staking.getStakingData(stakingPoolName); (IStakingRewards stakingContract, TokenInterface stakingToken, bytes32 stakingType) = staking.getStakingData(stakingPoolName);
stakedBal = stakingContract.balanceOf(user); stakedBal = stakingContract.balanceOf(user);
stakedBal = stakingContract.totalSupply();
rewardsEarned = stakingContract.earned(user); rewardsEarned = stakingContract.earned(user);
tokenBal = stakingToken.balanceOf(user); tokenBal = stakingToken.balanceOf(user);
tokenBal = stakingToken.totalSupply();
} }
} }