Skip to content

Solidity API

ERC20Extended

This contract inherits from:

  • IERC20Extended: Interface defining the extended approval functions
  • ERC20ExtendedInternal: Internal implementation of the extended functions

Implements safe approval extensions for the ERC20 standard This contract provides enhanced approval functionality to mitigate the transaction-ordering vulnerability in the standard ERC20 approve method (see https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729)

increaseAllowance

solidity
function increaseAllowance(address spender, uint256 amount) external returns (bool)

Increase the allowance granted to a spender

_External wrapper for increaseAllowance internal function Allows users to increase the amount a spender is allowed to transfer on their behalf without having to set the allowance to zero first

Parameters

NameTypeDescription
spenderaddressAddress to be granted increased spending rights
amountuint256The additional amount to add to the current allowance

Return Values

NameTypeDescription
[0]boolsuccess True if the operation succeeded

decreaseAllowance

solidity
function decreaseAllowance(address spender, uint256 amount) external returns (bool)

Decrease the allowance granted to a spender

_External wrapper for decreaseAllowance internal function Allows users to reduce the amount a spender is allowed to transfer on their behalf in a safe way

Parameters

NameTypeDescription
spenderaddressAddress whose spending rights will be reduced
amountuint256The amount to subtract from the current allowance

Return Values

NameTypeDescription
[0]boolsuccess True if the operation succeeded