Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add return value to fungible allowance #36

Merged
merged 1 commit into from
Jul 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hts-precompile/HederaTokenService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,12 @@ abstract contract HederaTokenService is HederaResponseCodes {
/// @param owner the owner of the tokens to be spent
/// @param spender the spender of the tokens
/// @return responseCode The response code for the status of the request. SUCCESS is 22.
function allowance(address token, address owner, address spender) internal returns (int responseCode)
function allowance(address token, address owner, address spender) internal returns (int responseCode, uint256 amount)
{
(bool success, bytes memory result) = precompileAddress.call(
abi.encodeWithSelector(IHederaTokenService.allowance.selector,
token, owner, spender));
responseCode = success ? abi.decode(result, (int32)) : HederaResponseCodes.UNKNOWN;
(responseCode, amount) = success ? abi.decode(result, (int32, uint256)) : (HederaResponseCodes.UNKNOWN, 0);
}

/// Allow or reaffirm the approved address to transfer an NFT the approved address does not own.
Expand Down