ERC20Approvals
Abstract contract that provides the approval operations of the ERC20 Data Manager
AllowanceAmount
Struct to store the amount of an allowance (used to optimize mapping access)
allowance
_Returns the remaining number of tokens that spender
will be
allowed to spend on behalf of owner
through {transferFrom}. This is
zero by default.
This value changes when {approve} or {transferFrom} are called._
approve
_Sets a value
amount of tokens as the allowance of spender
over the
caller's tokens.
Returns a boolean value indicating whether the operation succeeded.
IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
Emits an {Approval} event._
_spendAllowance
if the current allowance is max uint256, it will not be decreased