Skip to content

Commit

Permalink
Merge pull request #1495 from sbrichards/token-interfaces
Browse files Browse the repository at this point in the history
Import built-in interfaces in token examples
  • Loading branch information
jacqueswww authored Jun 25, 2019
2 parents 4f661c3 + 691e84c commit ec8e96e
Show file tree
Hide file tree
Showing 2 changed files with 8 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 @@ -2,6 +2,10 @@
# @author Takayuki Jimba (@yudetamago)
# https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md

from vyper.interfaces import ERC20

implements: ERC20

Transfer: event({_from: indexed(address), _to: indexed(address), _value: uint256})
Approval: event({_owner: indexed(address), _spender: indexed(address), _value: uint256})

Expand Down
4 changes: 4 additions & 0 deletions examples/tokens/ERC721.vy
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
# @author Ryuya Nakamura (@nrryuya)
# Modified from: https://github.com/ethereum/vyper/blob/de74722bf2d8718cca46902be165f9fe0e3641dd/examples/tokens/ERC721.vy

from vyper.interfaces import ERC721

implements: ERC721

# Interface for the contract called by safeTransferFrom()
contract ERC721Receiver:
def onERC721Received(
Expand Down

0 comments on commit ec8e96e

Please sign in to comment.