-
Notifications
You must be signed in to change notification settings - Fork 0
/
ERC20.etk
42 lines (32 loc) · 1.04 KB
/
ERC20.etk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# @author @sw0nt - Saw-mon and Natalie
# @notice https://eips.ethereum.org/EIPS/eip-20
%import("macros/instructions.etk")
# storage slots
# 0: maping(address => uint256) balanceOf
# 1: mapping(address => mapping(address => uint256)) allowance
%import("function_selector.etk")
# 4 byte sig
%import("functions/totalSupply.etk") # 0x18160ddd
%import("functions/balanceOf.etk") # 0x70a08231
%import("functions/transfer.etk") # 0xa9059cbb
%import("functions/transferFrom.etk") # 0x23b872dd
%import("functions/approve.etk") # 0x095ea7b3
%import("functions/allowance.etk") # 0xdd62ed3e
# optional
# %import("functions/name.etk")
# %import("functions/symbol.etk")
# %import("functions/decimals.etk")
# %import("functions/_mint.etk")
# %import("functions/_burn.etk")
returnValue:
jumpdest
returndatasize
mstore
push1 0x20
returndatasize
return
error:
jumpdest
returndatasize
returndatasize
revert