Skip to content

Commit

Permalink
add balanceOfUnderlying
Browse files Browse the repository at this point in the history
  • Loading branch information
brockelmore committed Aug 8, 2020
1 parent 1b00bf7 commit 4aa3f7d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
12 changes: 12 additions & 0 deletions contracts/token/YAM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,18 @@ contract YAMToken is YAMGovernanceToken {
return _yamBalances[who].mul(yamsScalingFactor).div(internalDecimals);
}

/** @notice Currently unused and not different from balanceOf
* @param who The address to query.
* @return The balance of the specified address.
*/
function balanceOfUnderlying(address who)
external
view
returns (uint256)
{
return _yamBalances[who].mul(yamsScalingFactor).div(internalDecimals);
}

/**
* @dev Function to check the amount of tokens that an owner has allowed to a spender.
* @param owner_ The address which owns the funds.
Expand Down
15 changes: 15 additions & 0 deletions contracts/token/YAMDelegator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,21 @@ contract YAMDelegator is YAM, YAMDelegatorInterface {
owner; // Shh
delegateToViewAndReturn();
}

/**
* @notice Currently unused. For future compatability
* @param owner The address of the account to query
* @return The number of underlying tokens owned by `owner`
*/
function balanceOfUnderlying(address owner)
external
view
returns (uint256)
{
owner; // Shh
delegateToViewAndReturn();
}

/*** Gov Functions ***/

/**
Expand Down
1 change: 1 addition & 0 deletions contracts/token/YAMTokenInterface.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ contract YAMTokenInterface is YAMTokenStorage {
function transfer(address to, uint256 value) external returns(bool);
function transferFrom(address from, address to, uint256 value) external returns(bool);
function balanceOf(address who) external view returns(uint256);
function balanceOfUnderlying(address who) external view returns(uint256);
function allowance(address owner_, address spender) external view returns(uint256);
function approve(address spender, uint256 value) external returns (bool);
function increaseAllowance(address spender, uint256 addedValue) external returns (bool);
Expand Down

0 comments on commit 4aa3f7d

Please sign in to comment.