You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some ERC20 tokens as MANA require to clear the approval before setting a new value
/** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */function approve(address_spender, uint256_value) returns (bool) {
// To change the approve amount you first have to reduce the addresses`// allowance to zero by calling `approve(_spender, 0)` if it is not// already 0 to mitigate the race condition described here:// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729require((_value ==0) || (allowed[msg.sender][_spender] ==0));
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
returntrue;
}
The idea is to support this behaviour cleaning the approval first and the set it the new one
The text was updated successfully, but these errors were encountered:
Some ERC20 tokens as MANA require to clear the approval before setting a new value
The idea is to support this behaviour cleaning the approval first and the set it the new one
The text was updated successfully, but these errors were encountered: