hiero-ledger / hiero-ledger/hiero-consensus-node
spender allowance does not decrease as allowance is spent
- Dominant language
- Java
- Stars
- 406
- Forks
- 226
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 210
Description
### Description
I initially created hashgraph/hedera-mirror-node-explorer/issues/567 , however, @ericleponner indicated that this is an issue at the service layer.
I assumed it was simply the mirror node returning a stale allowance(i.e. the allowance that was initially approved), but it seems it's not being updated at the service layer.
I'd also recommend interpreting `type(int64).max` as an infinite allowance(i.e. does not need to be decreased as spender spends) which is similar to ERC20 tokens where an allowance of `type(uint256).max` is interpreted as [an infinite approval/allowance](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/f959d7e4e6ee0b022b41e5b644c79369869d8411/contracts/token/ERC20/ERC20.sol#L129).
### Steps to reproduce
I'm not sure how to get both fungible and nonfungible token allowances using the SDK, I tried searching for a way to do so in the docs to no avail.
If there is a way then on _mainnet_ simply get the allowance for spender _0.0.2178425_ for token _0.0.2178426_ approved by account _0.0.1055570_, if the allowance is still 100 WHBAR then this confirms the issue.
### Additional context
_No response_
### Hedera network
mainnet
### Version
v0.36.4
### Operating system
None
Contributor guide
Assessment
This issue has not been assessed yet.