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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
//! EVM FFI.

#[link(wasm_import_module = "evm")]
#[allow(improper_ctypes)]
extern "C" {
    /// Push 1 byte to the stack.
    pub fn push0();

    /// Push 1 byte to the stack.
    pub fn push1(val: i32);

    /// Push 2 bytes to the stack.
    pub fn push2(val: i32);

    /// Push 3 bytes to the stack.
    pub fn push3(val: i32);

    /// Push 4 bytes to the stack.
    pub fn push4(val: i32);

    /// Push 5 bytes to the stack.
    pub fn push5(val: i32);

    /// Push 6 bytes to the stack.
    pub fn push6(val: i32);

    /// Push 7 bytes to the stack.
    pub fn push7(val: i32);

    /// Push 8 bytes to the stack.
    pub fn push8(val: i32);

    /// Push 9 bytes to the stack.
    pub fn push9(val: i32);

    /// Push 10 bytes to the stack.
    pub fn push10(val: i32);

    /// Push 11 bytes to the stack.
    pub fn push11(val: i32);

    /// Push 12 bytes to the stack.
    pub fn push12(val: i32);

    /// Push 13 bytes to the stack.
    pub fn push13(val: i32);

    /// Push 14 bytes to the stack.
    pub fn push14(val: i32);

    /// Push 15 bytes to the stack.
    pub fn push15(val: i32);

    /// Push 16 bytes to the stack.
    pub fn push16(val: i32);

    /// Push 17 bytes to the stack.
    pub fn push17(val: i32);

    /// Push 18 bytes to the stack.
    pub fn push18(val: i32);

    /// Push 19 bytes to the stack.
    pub fn push19(val: i32);

    /// Push 20 bytes to the stack.
    pub fn push20(val: i32);

    /// Push 21 bytes to the stack.
    pub fn push21(val: i32);

    /// Push 22 bytes to the stack.
    pub fn push22(val: i32);

    /// Push 23 bytes to the stack.
    pub fn push23(val: i32);

    /// Push 24 bytes to the stack.
    pub fn push24(val: i32);

    /// Push 25 bytes to the stack.
    pub fn push25(val: i32);

    /// Push 26 bytes to the stack.
    pub fn push26(val: i32);

    /// Push 27 bytes to the stack.
    pub fn push27(val: i32);

    /// Push 28 bytes to the stack.
    pub fn push28(val: i32);

    /// Push 29 bytes to the stack.
    pub fn push29(val: i32);

    /// Push 30 bytes to the stack.
    pub fn push30(val: i32);

    /// Push 31 bytes to the stack.
    pub fn push31(val: i32);

    /// Push 32 bytes to the stack.
    pub fn push32(val: i32);

    /// Store a value in the storage
    pub fn sstore();

    /// Load a value from the storage
    pub fn sload();

    /// Append log record with no topics
    pub fn log0(name: &'static [u8]);

    /// Append log record with one topics
    pub fn log1(name: &'static [u8], topic1: &'static [u8]);

    /// Append log record with two topics
    pub fn log2(name: &'static [u8], topic1: &'static [u8], topic2: &'static [u8]);

    /// Append log record with three topics
    pub fn log3(
        name: &'static [u8],
        topic1: &'static [u8],
        topic2: &'static [u8],
        topic3: &'static [u8],
    );

    /// Append log record with four topics
    pub fn log4(
        name: &'static [u8],
        topic1: &'static [u8],
        topic2: &'static [u8],
        topic3: &'static [u8],
        topic4: &'static [u8],
    );
}