mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fixed table formatting
This commit is contained in:
parent
51fe1bd9c2
commit
d70ae38e92
@ -335,147 +335,147 @@ In the following, `mem[a...b)` signifies the bytes of memory starting at positio
|
||||
|
||||
The opcodes `pushi` and `jumpdest` cannot be used directly.
|
||||
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| stop + `-` | stop execution, identical to return(0,0) |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| add(x, y) | | x + y |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| sub(x, y) | | x - y |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| mul(x, y) | | x * y |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| div(x, y) | | x / y |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| sdiv(x, y) | | x / y, for signed numbers in two's complement |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| mod(x, y) | | x % y |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| smod(x, y) | | x % y, for signed numbers in two's complement |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| exp(x, y) | | x to the power of y |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| not(x) | | ~x, every bit of x is negated |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| lt(x, y) | | 1 if x < y, 0 otherwise |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| gt(x, y) | | 1 if x > y, 0 otherwise |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| slt(x, y) | |1 if x < y, 0 otherwise, for signed numbers in two's complement|
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| sgt(x, y) | |1 if x > y, 0 otherwise, for signed numbers in two's complement|
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| eq(x, y) | | 1 if x == y, 0 otherwise |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| iszero(x) | | 1 if x == 0, 0 otherwise |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| and(x, y) | | bitwise and of x and y |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| or(x, y) | | bitwise or of x and y |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| xor(x, y) | | bitwise xor of x and y |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| byte(n, x) | | nth byte of x, where the most significant byte is the 0th byte|
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| addmod(x, y, m) | | (x + y) % m with arbitrary precision arithmetics |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| mulmod(x, y, m) | | (x * y) % m with arbitrary precision arithmetics |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| signextend(i, x) | | sign extend from (i*8+7)th bit counting from least significant|
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| sha3(p, n) | | keccak(mem[p...(p+n))) |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| jump(label) | `-` | jump to label / code position |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| jumpi(label, cond) | `-` | jump to label if cond is nonzero |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| pc | | current position in code |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| pop | `*` | remove topmost stack slot |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| dup1 ... dup16 | | copy ith stack slot to the top (counting from top) |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| swap1 ... swap1 | `*` | swap topmost and ith stack slot below it |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| mload(p) | | mem[p..(p+32)) |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| mstore(p, v) | `-` | mem[p..(p+32)) := v |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| mstore8(p, v) | `-` | mem[p] := v & 0xff - only modifies a single byte |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| sload(p) | | storage[p] |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| sstore(p, v) | `-` | storage[p] := v |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| msize | | size of memory, i.e. largest accessed memory index |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| gas | | gas still available to execution |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| address | | address of the current contract / execution context |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| balance(a) | | wei balance at address a |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| caller | | call sender (excluding delegatecall) |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| callvalue | | wei sent together with the current call |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| calldataload(p) | | call data starting from position p (32 bytes) |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| calldatasize | | size of call data in bytes |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| calldatacopy(t, f, s) | `-` | copy s bytes from calldata at position f to mem at position t |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| codesize | | size of the code of the current contract / execution context |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| codecopy(t, f, s) | `-` | copy s bytes from code at position f to mem at position t |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| extcodesize(a) | | size of the code at address a |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
|extcodecopy(a, t, f, s)| `-` | like codecopy(t, f, s) but take code at address a |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| create(v, p, s) | | create new contract with code mem[p..(p+s)) and send v wei |
|
||||
| | | and return the new address |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| call(g, a, v, in, | | call contract at address a with input mem[in..(in+insize)] |
|
||||
| insize, out, outsize) | | providing g gas and v wei and output area |
|
||||
| | | mem[out..(out+outsize)] returting 1 on error (out of gas) |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| callcode(g, a, v, in, | | identical to call but only use the code from a and stay |
|
||||
| insize, out, outsize) | | in the context of the current contract otherwise |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| delegatecall(g, a, in,| | identical to callcode but also keep `caller` and `callvalue` |
|
||||
| insize, out, outsize) | | |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| return(p, s) | `*` | end execution, return data mem[p..(p+s)) |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| selfdestruct(a) | `*` | end execution, destroy current contract and send funds to a |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| log0(p, s) | `-` | log without topics and data mem[p..(p+s)) |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| log1(p, s, t1) | `-` | log with topic t1 and data mem[p..(p+s)) |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| log2(p, s, t1, t2) | `-` | log with topics t1, t2 and data mem[p..(p+s)) |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| log3(p, s, t1, t2, t3)| `-` | log with topics t1, t2, t3 and data mem[p..(p+s)) |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| log4(p, s, t1, t2, t3,| `-` | log with topics t1, t2, t3, t4 and data mem[p..(p+s)) |
|
||||
| t4) | | |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| origin | | transaction sender |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| gasprice | | gas price of the transaction |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| blockhash(b) | |hash of block nr b - only for last 256 blocks excluding current|
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| coinbase | | current mining beneficiary |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| timestamp | | timestamp of the current block in seconds since the epoch |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| number | | current block number |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| difficulty | | difficulty of the current block |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
| gaslimit | | block gas limit of the current block |
|
||||
+-----------------------+------+---------------------------------------------------------------+
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| stop + `-` | stop execution, identical to return(0,0) |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| add(x, y) | | x + y |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| sub(x, y) | | x - y |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| mul(x, y) | | x * y |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| div(x, y) | | x / y |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| sdiv(x, y) | | x / y, for signed numbers in two's complement |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| mod(x, y) | | x % y |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| smod(x, y) | | x % y, for signed numbers in two's complement |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| exp(x, y) | | x to the power of y |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| bnot(x) | | ~x, every bit of x is negated |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| lt(x, y) | | 1 if x < y, 0 otherwise |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| gt(x, y) | | 1 if x > y, 0 otherwise |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| slt(x, y) | | 1 if x < y, 0 otherwise, for signed numbers in two's complement |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| sgt(x, y) | | 1 if x > y, 0 otherwise, for signed numbers in two's complement |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| eq(x, y) | | 1 if x == y, 0 otherwise |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| not(x) | | 1 if x == 0, 0 otherwise |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| and(x, y) | | bitwise and of x and y |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| or(x, y) | | bitwise or of x and y |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| xor(x, y) | | bitwise xor of x and y |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| byte(n, x) | | nth byte of x, where the most significant byte is the 0th byte |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| addmod(x, y, m) | | (x + y) % m with arbitrary precision arithmetics |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| mulmod(x, y, m) | | (x * y) % m with arbitrary precision arithmetics |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| signextend(i, x) | | sign extend from (i*8+7)th bit counting from least significant |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| sha3(p, n) | | keccak(mem[p...(p+n))) |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| jump(label) | `-` | jump to label / code position |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| jumpi(label, cond) | `-` | jump to label if cond is nonzero |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| pc | | current position in code |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| pop | `*` | remove topmost stack slot |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| dup1 ... dup16 | | copy ith stack slot to the top (counting from top) |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| swap1 ... swap1 | `*` | swap topmost and ith stack slot below it |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| mload(p) | | mem[p..(p+32)) |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| mstore(p, v) | `-` | mem[p..(p+32)) := v |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| mstore8(p, v) | `-` | mem[p] := v & 0xff - only modifies a single byte |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| sload(p) | | storage[p] |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| sstore(p, v) | `-` | storage[p] := v |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| msize | | size of memory, i.e. largest accessed memory index |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| gas | | gas still available to execution |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| address | | address of the current contract / execution context |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| balance(a) | | wei balance at address a |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| caller | | call sender (excluding delegatecall) |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| callvalue | | wei sent together with the current call |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| calldataload(p) | | call data starting from position p (32 bytes) |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| calldatasize | | size of call data in bytes |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| calldatacopy(t, f, s) | `-` | copy s bytes from calldata at position f to mem at position t |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| codesize | | size of the code of the current contract / execution context |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| codecopy(t, f, s) | `-` | copy s bytes from code at position f to mem at position t |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| extcodesize(a) | | size of the code at address a |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| extcodecopy(a, t, f, s) | `-` | like codecopy(t, f, s) but take code at address a |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| create(v, p, s) | | create new contract with code mem[p..(p+s)) and send v wei |
|
||||
| | | and return the new address |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| call(g, a, v, in, | | call contract at address a with input mem[in..(in+insize)] |
|
||||
| insize, out, outsize) | | providing g gas and v wei and output area |
|
||||
| | | mem[out..(out+outsize)] returting 1 on error (out of gas) |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| callcode(g, a, v, in, | | identical to call but only use the code from a and stay |
|
||||
| insize, out, outsize) | | in the context of the current contract otherwise |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| delegatecall(g, a, in, | | identical to callcode but also keep `caller` and `callvalue` |
|
||||
| insize, out, outsize) | | |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| return(p, s) | `*` | end execution, return data mem[p..(p+s)) |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| selfdestruct(a) | `*` | end execution, destroy current contract and send funds to a |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| log0(p, s) | `-` | log without topics and data mem[p..(p+s)) |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| log1(p, s, t1) | `-` | log with topic t1 and data mem[p..(p+s)) |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| log2(p, s, t1, t2) | `-` | log with topics t1, t2 and data mem[p..(p+s)) |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| log3(p, s, t1, t2, t3) | `-` | log with topics t1, t2, t3 and data mem[p..(p+s)) |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| log4(p, s, t1, t2, t3, | `-` | log with topics t1, t2, t3, t4 and data mem[p..(p+s)) |
|
||||
| t4) | | |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| origin | | transaction sender |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| gasprice | | gas price of the transaction |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| blockhash(b) | | hash of block nr b - only for last 256 blocks excluding current |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| coinbase | | current mining beneficiary |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| timestamp | | timestamp of the current block in seconds since the epoch |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| number | | current block number |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| difficulty | | difficulty of the current block |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
| gaslimit | | block gas limit of the current block |
|
||||
+-------------------------+------+-----------------------------------------------------------------+
|
||||
|
||||
Literals
|
||||
--------
|
||||
|
Loading…
Reference in New Issue
Block a user