Skip to content

Fail with error 'SafeMath: subtraction overflow' & SafeMath error on sending tokens via contract #7

Discussion options

You must be logged in to vote

Assuming that the address calling ContractA hasn't set an allowance for the contract.

Requirements:

  • The caller must have an allowance for the sender's tokens of at least amount:: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.3.0/contracts/token/ERC20/ERC20.sol
  •    * @dev See `IERC20.transferFrom`.
       *
       * Emits an `Approval` event indicating the updated allowance. This is not
       * required by the EIP. See the note at the beginning of `ERC20`;
       *
       * Requirements:
       * - `sender` and `recipient` cannot be the zero address.
       * - `sender` must have a balance of at least `value`.
       * - The caller must have an allowance for `sender`'s tokens of at least
       * `amount…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Leptron-Technologies
Comment options

Answer selected by Leptron-Technologies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants