Skip to content

Commit

Permalink
Added comment for clarifying not using assert
Browse files Browse the repository at this point in the history
  • Loading branch information
ssteiger authored Feb 8, 2019
1 parent 7558b23 commit cddb913
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/tokens/ERC20.vy
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ def transfer(_to : address, _value : uint256) -> bool:
@param _to The address to transfer to.
@param _value The amount to be transferred.
"""
# NOTE: vyper does not allow unterflows
# so checks for sufficient funds/allowances are done implicitly
self.balances[msg.sender] -= _value
self.balances[_to] += _value
log.Transfer(msg.sender, _to, _value)
Expand All @@ -80,6 +82,8 @@ def transferFrom(_from : address, _to : address, _value : uint256) -> bool:
@param _to address The address which you want to transfer to
@param _value uint256 the amount of tokens to be transferred
"""
# NOTE: vyper does not allow unterflows
# so checks for sufficient funds/allowances are done implicitly
self.balances[_from] -= _value
self.balances[_to] += _value
self.allowances[_from][msg.sender] -= _value
Expand Down

0 comments on commit cddb913

Please sign in to comment.