-
-
Notifications
You must be signed in to change notification settings - Fork 806
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor builtin interfaces to
.vyi
files
- Loading branch information
1 parent
b61176e
commit 6c7f795
Showing
6 changed files
with
63 additions
and
67 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
vyper/builtins/interfaces/ERC165.vy → vyper/builtins/interfaces/ERC165.vyi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@view | ||
@external | ||
def supportsInterface(interface_id: bytes4) -> bool: | ||
pass | ||
... |
24 changes: 12 additions & 12 deletions
24
vyper/builtins/interfaces/ERC20.vy → vyper/builtins/interfaces/ERC20.vyi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
# Events | ||
event Transfer: | ||
_from: indexed(address) | ||
_to: indexed(address) | ||
_value: uint256 | ||
sender: indexed(address) | ||
recipient: indexed(address) | ||
value: uint256 | ||
|
||
event Approval: | ||
_owner: indexed(address) | ||
_spender: indexed(address) | ||
_value: uint256 | ||
owner: indexed(address) | ||
spender: indexed(address) | ||
value: uint256 | ||
|
||
# Functions | ||
@view | ||
@external | ||
def totalSupply() -> uint256: | ||
pass | ||
... | ||
|
||
@view | ||
@external | ||
def balanceOf(_owner: address) -> uint256: | ||
pass | ||
... | ||
|
||
@view | ||
@external | ||
def allowance(_owner: address, _spender: address) -> uint256: | ||
pass | ||
... | ||
|
||
@external | ||
def transfer(_to: address, _value: uint256) -> bool: | ||
pass | ||
... | ||
|
||
@external | ||
def transferFrom(_from: address, _to: address, _value: uint256) -> bool: | ||
pass | ||
... | ||
|
||
@external | ||
def approve(_spender: address, _value: uint256) -> bool: | ||
pass | ||
... |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@view | ||
@external | ||
def name() -> String[...]: | ||
... | ||
|
||
@view | ||
@external | ||
def symbol() -> String[...]: | ||
... | ||
|
||
@view | ||
@external | ||
def decimals() -> uint8: | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 20 additions & 20 deletions
40
vyper/builtins/interfaces/ERC721.vy → vyper/builtins/interfaces/ERC721.vyi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,67 @@ | ||
# Events | ||
|
||
event Transfer: | ||
_from: indexed(address) | ||
_to: indexed(address) | ||
_tokenId: indexed(uint256) | ||
sender: indexed(address) | ||
recipient: indexed(address) | ||
token_id: indexed(uint256) | ||
|
||
event Approval: | ||
_owner: indexed(address) | ||
_approved: indexed(address) | ||
_tokenId: indexed(uint256) | ||
owner: indexed(address) | ||
approved: indexed(address) | ||
token_id: indexed(uint256) | ||
|
||
event ApprovalForAll: | ||
_owner: indexed(address) | ||
_operator: indexed(address) | ||
_approved: bool | ||
owner: indexed(address) | ||
operator: indexed(address) | ||
approved: bool | ||
|
||
# Functions | ||
|
||
@view | ||
@external | ||
def supportsInterface(interface_id: bytes4) -> bool: | ||
pass | ||
... | ||
|
||
@view | ||
@external | ||
def balanceOf(_owner: address) -> uint256: | ||
pass | ||
... | ||
|
||
@view | ||
@external | ||
def ownerOf(_tokenId: uint256) -> address: | ||
pass | ||
... | ||
|
||
@view | ||
@external | ||
def getApproved(_tokenId: uint256) -> address: | ||
pass | ||
... | ||
|
||
@view | ||
@external | ||
def isApprovedForAll(_owner: address, _operator: address) -> bool: | ||
pass | ||
... | ||
|
||
@external | ||
@payable | ||
def transferFrom(_from: address, _to: address, _tokenId: uint256): | ||
pass | ||
... | ||
|
||
@external | ||
@payable | ||
def safeTransferFrom(_from: address, _to: address, _tokenId: uint256): | ||
pass | ||
... | ||
|
||
@external | ||
@payable | ||
def safeTransferFrom(_from: address, _to: address, _tokenId: uint256, _data: Bytes[1024]): | ||
pass | ||
def safeTransferFrom(_from: address, _to: address, _tokenId: uint256, _data: Bytes[...]): | ||
... | ||
|
||
@external | ||
@payable | ||
def approve(_approved: address, _tokenId: uint256): | ||
pass | ||
... | ||
|
||
@external | ||
def setApprovalForAll(_operator: address, _approved: bool): | ||
pass | ||
... |