|
@@ -1,3 +1,4 @@
|
|
|
|
|
+use crate::Target;
|
|
|
use phf::{phf_map, phf_set};
|
|
use phf::{phf_map, phf_set};
|
|
|
|
|
|
|
|
pub struct YulBuiltinPrototype {
|
|
pub struct YulBuiltinPrototype {
|
|
@@ -7,6 +8,18 @@ pub struct YulBuiltinPrototype {
|
|
|
pub doc: &'static str,
|
|
pub doc: &'static str,
|
|
|
pub ty: YulBuiltInFunction,
|
|
pub ty: YulBuiltInFunction,
|
|
|
pub stops_execution: bool,
|
|
pub stops_execution: bool,
|
|
|
|
|
+ pub availability: [bool; 3],
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+impl YulBuiltinPrototype {
|
|
|
|
|
+ /// Checks if a certain Yul builtin is available for the given target
|
|
|
|
|
+ pub fn is_available(&self, target: &Target) -> bool {
|
|
|
|
|
+ match target {
|
|
|
|
|
+ Target::Ewasm => self.availability[0],
|
|
|
|
|
+ Target::Substrate { .. } => self.availability[1],
|
|
|
|
|
+ Target::Solana => self.availability[2],
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// The enums declaration order should match that of the static vector containing the builtins
|
|
// The enums declaration order should match that of the static vector containing the builtins
|
|
@@ -257,6 +270,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Stop execution",
|
|
doc: "Stop execution",
|
|
|
ty: YulBuiltInFunction::Stop,
|
|
ty: YulBuiltInFunction::Stop,
|
|
|
stops_execution: true,
|
|
stops_execution: true,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "add",
|
|
name: "add",
|
|
@@ -265,6 +279,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "add(x, y) returns x + y",
|
|
doc: "add(x, y) returns x + y",
|
|
|
ty: YulBuiltInFunction::Add,
|
|
ty: YulBuiltInFunction::Add,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "sub",
|
|
name: "sub",
|
|
@@ -273,6 +288,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "sub(x, y) returns x - y",
|
|
doc: "sub(x, y) returns x - y",
|
|
|
ty: YulBuiltInFunction::Sub,
|
|
ty: YulBuiltInFunction::Sub,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "mul",
|
|
name: "mul",
|
|
@@ -281,6 +297,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "mul(x, y) returns x*y",
|
|
doc: "mul(x, y) returns x*y",
|
|
|
ty: YulBuiltInFunction::Mul,
|
|
ty: YulBuiltInFunction::Mul,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "div",
|
|
name: "div",
|
|
@@ -289,6 +306,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "div(x, y) returns x/y or 0 if y == 0",
|
|
doc: "div(x, y) returns x/y or 0 if y == 0",
|
|
|
ty: YulBuiltInFunction::Div,
|
|
ty: YulBuiltInFunction::Div,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "sdiv",
|
|
name: "sdiv",
|
|
@@ -297,6 +315,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "sdiv(x, y) returns x/y or 0 if y==0. Used for signed numbers in two's complement",
|
|
doc: "sdiv(x, y) returns x/y or 0 if y==0. Used for signed numbers in two's complement",
|
|
|
ty: YulBuiltInFunction::SDiv,
|
|
ty: YulBuiltInFunction::SDiv,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "mod",
|
|
name: "mod",
|
|
@@ -305,6 +324,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "mod(x, y) returns x % y or 0 if y == 0",
|
|
doc: "mod(x, y) returns x % y or 0 if y == 0",
|
|
|
ty: YulBuiltInFunction::Mod,
|
|
ty: YulBuiltInFunction::Mod,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "smod",
|
|
name: "smod",
|
|
@@ -313,6 +333,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "smod(x, y) returns x % y or 0 if y == 0. Used for signed numbers in two's complement",
|
|
doc: "smod(x, y) returns x % y or 0 if y == 0. Used for signed numbers in two's complement",
|
|
|
ty: YulBuiltInFunction::SMod,
|
|
ty: YulBuiltInFunction::SMod,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "exp",
|
|
name: "exp",
|
|
@@ -321,6 +342,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "exp(x, y) returns x to the power of y",
|
|
doc: "exp(x, y) returns x to the power of y",
|
|
|
ty: YulBuiltInFunction::Exp,
|
|
ty: YulBuiltInFunction::Exp,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "not",
|
|
name: "not",
|
|
@@ -329,6 +351,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "not(x): bitwise \"not\" of x (every bit is negated)",
|
|
doc: "not(x): bitwise \"not\" of x (every bit is negated)",
|
|
|
ty: YulBuiltInFunction::Not,
|
|
ty: YulBuiltInFunction::Not,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "lt",
|
|
name: "lt",
|
|
@@ -337,6 +360,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "lt(x, y) returns 1 if x < y, 0 otherwise",
|
|
doc: "lt(x, y) returns 1 if x < y, 0 otherwise",
|
|
|
ty: YulBuiltInFunction::Lt,
|
|
ty: YulBuiltInFunction::Lt,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "gt",
|
|
name: "gt",
|
|
@@ -345,6 +369,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "gt(x, y) returns 1 if x > y, 0 otherwise",
|
|
doc: "gt(x, y) returns 1 if x > y, 0 otherwise",
|
|
|
ty: YulBuiltInFunction::Gt,
|
|
ty: YulBuiltInFunction::Gt,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "slt",
|
|
name: "slt",
|
|
@@ -353,6 +378,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "slt(x, y) returns 1 if x > y, 0 otherwise. Used for signed numbers in two's complement",
|
|
doc: "slt(x, y) returns 1 if x > y, 0 otherwise. Used for signed numbers in two's complement",
|
|
|
ty: YulBuiltInFunction::Slt,
|
|
ty: YulBuiltInFunction::Slt,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "sgt",
|
|
name: "sgt",
|
|
@@ -361,6 +387,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "sgt(x, y) returns 1 if x > y, 0 otherwise. Used for signed numbers in two's complement",
|
|
doc: "sgt(x, y) returns 1 if x > y, 0 otherwise. Used for signed numbers in two's complement",
|
|
|
ty: YulBuiltInFunction::Sgt,
|
|
ty: YulBuiltInFunction::Sgt,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "eq",
|
|
name: "eq",
|
|
@@ -369,6 +396,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "eq(x, y) returns 1 if x == y, 0 otherwise",
|
|
doc: "eq(x, y) returns 1 if x == y, 0 otherwise",
|
|
|
ty: YulBuiltInFunction::Eq,
|
|
ty: YulBuiltInFunction::Eq,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "iszero",
|
|
name: "iszero",
|
|
@@ -377,6 +405,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "iszero(x) returns 1 if x == 0, 0 otherwise",
|
|
doc: "iszero(x) returns 1 if x == 0, 0 otherwise",
|
|
|
ty: YulBuiltInFunction::IsZero,
|
|
ty: YulBuiltInFunction::IsZero,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "and",
|
|
name: "and",
|
|
@@ -385,6 +414,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "and(x, y) returns the bitwise \"and\" between x and y",
|
|
doc: "and(x, y) returns the bitwise \"and\" between x and y",
|
|
|
ty: YulBuiltInFunction::And,
|
|
ty: YulBuiltInFunction::And,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "or",
|
|
name: "or",
|
|
@@ -393,6 +423,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "or(x, y) returns the bitwise \"or\" between x and y",
|
|
doc: "or(x, y) returns the bitwise \"or\" between x and y",
|
|
|
ty: YulBuiltInFunction::Or,
|
|
ty: YulBuiltInFunction::Or,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "xor",
|
|
name: "xor",
|
|
@@ -401,6 +432,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "xor(x, y) returns the bitwise \"xor\" between x and y",
|
|
doc: "xor(x, y) returns the bitwise \"xor\" between x and y",
|
|
|
ty: YulBuiltInFunction::Xor,
|
|
ty: YulBuiltInFunction::Xor,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "byte",
|
|
name: "byte",
|
|
@@ -409,6 +441,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "byte(n, x) returns the nth byte of x, where the most significant byte is the 0th",
|
|
doc: "byte(n, x) returns the nth byte of x, where the most significant byte is the 0th",
|
|
|
ty: YulBuiltInFunction::Byte,
|
|
ty: YulBuiltInFunction::Byte,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "shl",
|
|
name: "shl",
|
|
@@ -417,6 +450,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "shl(x, y) returns the logical shift left of y by x bits",
|
|
doc: "shl(x, y) returns the logical shift left of y by x bits",
|
|
|
ty: YulBuiltInFunction::Shl,
|
|
ty: YulBuiltInFunction::Shl,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "shr",
|
|
name: "shr",
|
|
@@ -425,6 +459,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "shr(x, y) returns the logical shift right of y by x bits",
|
|
doc: "shr(x, y) returns the logical shift right of y by x bits",
|
|
|
ty: YulBuiltInFunction::Shr,
|
|
ty: YulBuiltInFunction::Shr,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "sar",
|
|
name: "sar",
|
|
@@ -433,6 +468,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "signed arithmetic shift right y by x bits",
|
|
doc: "signed arithmetic shift right y by x bits",
|
|
|
ty: YulBuiltInFunction::Sar,
|
|
ty: YulBuiltInFunction::Sar,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "addmod",
|
|
name: "addmod",
|
|
@@ -441,6 +477,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "addmod(x, y, m) returns (x + y) % m or 0 if m == 0",
|
|
doc: "addmod(x, y, m) returns (x + y) % m or 0 if m == 0",
|
|
|
ty: YulBuiltInFunction::AddMod,
|
|
ty: YulBuiltInFunction::AddMod,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "mulmod",
|
|
name: "mulmod",
|
|
@@ -449,6 +486,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "mulmod(x, y, m) returns (x * y) % m or 0 if m == 0",
|
|
doc: "mulmod(x, y, m) returns (x * y) % m or 0 if m == 0",
|
|
|
ty: YulBuiltInFunction::MulMod,
|
|
ty: YulBuiltInFunction::MulMod,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "signextend",
|
|
name: "signextend",
|
|
@@ -457,6 +495,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "signextend(i, x) sign extends from (i*8+7)th bit counting from least significant",
|
|
doc: "signextend(i, x) sign extends from (i*8+7)th bit counting from least significant",
|
|
|
ty: YulBuiltInFunction::SignExtend,
|
|
ty: YulBuiltInFunction::SignExtend,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "keccak256",
|
|
name: "keccak256",
|
|
@@ -465,6 +504,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "keccak256(p, n) performs keccak(mem[p...(p+n)])",
|
|
doc: "keccak256(p, n) performs keccak(mem[p...(p+n)])",
|
|
|
ty: YulBuiltInFunction::Keccak256,
|
|
ty: YulBuiltInFunction::Keccak256,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "pc",
|
|
name: "pc",
|
|
@@ -473,6 +513,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Returns the current position in code, i.e. the program counter",
|
|
doc: "Returns the current position in code, i.e. the program counter",
|
|
|
ty: YulBuiltInFunction::Pc,
|
|
ty: YulBuiltInFunction::Pc,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "pop",
|
|
name: "pop",
|
|
@@ -481,6 +522,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "pop(x) discard value x",
|
|
doc: "pop(x) discard value x",
|
|
|
ty: YulBuiltInFunction::Pop,
|
|
ty: YulBuiltInFunction::Pop,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "mload",
|
|
name: "mload",
|
|
@@ -489,6 +531,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "mload(p) returns mem[p...(p+32)]",
|
|
doc: "mload(p) returns mem[p...(p+32)]",
|
|
|
ty: YulBuiltInFunction::MLoad,
|
|
ty: YulBuiltInFunction::MLoad,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "mstore",
|
|
name: "mstore",
|
|
@@ -497,6 +540,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "mstore(p, v) stores v into mem[p...(p+32)]",
|
|
doc: "mstore(p, v) stores v into mem[p...(p+32)]",
|
|
|
ty: YulBuiltInFunction::MStore,
|
|
ty: YulBuiltInFunction::MStore,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "mstore8",
|
|
name: "mstore8",
|
|
@@ -505,6 +549,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "mstore8(p, v) stores (v & 0xff) into mem[p] (modified a single byte of v)",
|
|
doc: "mstore8(p, v) stores (v & 0xff) into mem[p] (modified a single byte of v)",
|
|
|
ty: YulBuiltInFunction::MStore8,
|
|
ty: YulBuiltInFunction::MStore8,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "sload",
|
|
name: "sload",
|
|
@@ -513,6 +558,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "sload(p) returns storage[p], i.e. memory on contract's storage",
|
|
doc: "sload(p) returns storage[p], i.e. memory on contract's storage",
|
|
|
ty: YulBuiltInFunction::SLoad,
|
|
ty: YulBuiltInFunction::SLoad,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "sstore",
|
|
name: "sstore",
|
|
@@ -521,6 +567,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "sstore(p) stores v into storage[p]",
|
|
doc: "sstore(p) stores v into storage[p]",
|
|
|
ty: YulBuiltInFunction::SStore,
|
|
ty: YulBuiltInFunction::SStore,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "msize",
|
|
name: "msize",
|
|
@@ -529,6 +576,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Returns the size of memory, i.e largest accessed memory index",
|
|
doc: "Returns the size of memory, i.e largest accessed memory index",
|
|
|
ty: YulBuiltInFunction::MSize,
|
|
ty: YulBuiltInFunction::MSize,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "gas",
|
|
name: "gas",
|
|
@@ -537,6 +585,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Returns gas still available to execution",
|
|
doc: "Returns gas still available to execution",
|
|
|
ty: YulBuiltInFunction::Gas,
|
|
ty: YulBuiltInFunction::Gas,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "address",
|
|
name: "address",
|
|
@@ -545,6 +594,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Returns the address of the current contract / execution context",
|
|
doc: "Returns the address of the current contract / execution context",
|
|
|
ty: YulBuiltInFunction::Address,
|
|
ty: YulBuiltInFunction::Address,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "balance",
|
|
name: "balance",
|
|
@@ -553,6 +603,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "balance(a) returns the wei balance at address a",
|
|
doc: "balance(a) returns the wei balance at address a",
|
|
|
ty: YulBuiltInFunction::Balance,
|
|
ty: YulBuiltInFunction::Balance,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "selfbalance",
|
|
name: "selfbalance",
|
|
@@ -561,6 +612,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Returns the wei balance at the address of the current contract / execution context",
|
|
doc: "Returns the wei balance at the address of the current contract / execution context",
|
|
|
ty: YulBuiltInFunction::SelfBalance,
|
|
ty: YulBuiltInFunction::SelfBalance,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "caller",
|
|
name: "caller",
|
|
@@ -569,6 +621,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Returns the call sender",
|
|
doc: "Returns the call sender",
|
|
|
ty: YulBuiltInFunction::Caller,
|
|
ty: YulBuiltInFunction::Caller,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "callvalue",
|
|
name: "callvalue",
|
|
@@ -577,6 +630,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Returns the wei sent together with the current call",
|
|
doc: "Returns the wei sent together with the current call",
|
|
|
ty: YulBuiltInFunction::CallValue,
|
|
ty: YulBuiltInFunction::CallValue,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "calldataload",
|
|
name: "calldataload",
|
|
@@ -585,6 +639,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "calldataload(p) returns call data starting from position p (32 bytes)",
|
|
doc: "calldataload(p) returns call data starting from position p (32 bytes)",
|
|
|
ty: YulBuiltInFunction::CallDataLoad,
|
|
ty: YulBuiltInFunction::CallDataLoad,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "calldatasize",
|
|
name: "calldatasize",
|
|
@@ -593,6 +648,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Returns the size of call data in bytes",
|
|
doc: "Returns the size of call data in bytes",
|
|
|
ty: YulBuiltInFunction::CallDataSize,
|
|
ty: YulBuiltInFunction::CallDataSize,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "calldatacopy",
|
|
name: "calldatacopy",
|
|
@@ -601,6 +657,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "calldatacopy(t, f, s) copies s bytes from calldata at position f to mem at position t",
|
|
doc: "calldatacopy(t, f, s) copies s bytes from calldata at position f to mem at position t",
|
|
|
ty: YulBuiltInFunction::CallDataCopy,
|
|
ty: YulBuiltInFunction::CallDataCopy,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "codesize",
|
|
name: "codesize",
|
|
@@ -609,6 +666,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Returns the size of the current contract / execution context",
|
|
doc: "Returns the size of the current contract / execution context",
|
|
|
ty: YulBuiltInFunction::CodeSize,
|
|
ty: YulBuiltInFunction::CodeSize,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "codecopy",
|
|
name: "codecopy",
|
|
@@ -617,6 +675,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "codecopy(t, f, s) copies s bytes from code at position f to mem at position t",
|
|
doc: "codecopy(t, f, s) copies s bytes from code at position f to mem at position t",
|
|
|
ty: YulBuiltInFunction::CodeCopy,
|
|
ty: YulBuiltInFunction::CodeCopy,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "extcodesize",
|
|
name: "extcodesize",
|
|
@@ -625,6 +684,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "extcodesize(a) returns the size of the code at address a",
|
|
doc: "extcodesize(a) returns the size of the code at address a",
|
|
|
ty: YulBuiltInFunction::ExtCodeSize,
|
|
ty: YulBuiltInFunction::ExtCodeSize,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "extcodecopy",
|
|
name: "extcodecopy",
|
|
@@ -633,6 +693,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "extcodecopy(a, t, f, s) copies s bytes from code located at address a at position f to mem at position t",
|
|
doc: "extcodecopy(a, t, f, s) copies s bytes from code located at address a at position f to mem at position t",
|
|
|
ty: YulBuiltInFunction::ExtCodeCopy,
|
|
ty: YulBuiltInFunction::ExtCodeCopy,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "returndatasize",
|
|
name: "returndatasize",
|
|
@@ -641,6 +702,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Returns the size of the last returndata",
|
|
doc: "Returns the size of the last returndata",
|
|
|
ty: YulBuiltInFunction::ReturnDataSize,
|
|
ty: YulBuiltInFunction::ReturnDataSize,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "returndatacopy",
|
|
name: "returndatacopy",
|
|
@@ -649,6 +711,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "returndatacopy(t, f, s) copy s bytes from return data at position f to mem at position t",
|
|
doc: "returndatacopy(t, f, s) copy s bytes from return data at position f to mem at position t",
|
|
|
ty: YulBuiltInFunction::ReturnDataCopy,
|
|
ty: YulBuiltInFunction::ReturnDataCopy,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "extcodehash",
|
|
name: "extcodehash",
|
|
@@ -657,6 +720,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "extcodehash(a) returns the code hash of address a",
|
|
doc: "extcodehash(a) returns the code hash of address a",
|
|
|
ty: YulBuiltInFunction::ExtCodeHash,
|
|
ty: YulBuiltInFunction::ExtCodeHash,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "create",
|
|
name: "create",
|
|
@@ -665,6 +729,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "create(v, p, n) creates new contract with code mem[p..(p+n)] and sends v wei. It returns the new address or 0 on error",
|
|
doc: "create(v, p, n) creates new contract with code mem[p..(p+n)] and sends v wei. It returns the new address or 0 on error",
|
|
|
ty: YulBuiltInFunction::Create,
|
|
ty: YulBuiltInFunction::Create,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "create2",
|
|
name: "create2",
|
|
@@ -673,6 +738,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "create2(v, p, n, s) new contract with code mem[p...(p+n)] at address keccak256(0xff . this . s . keccak256(mem[p...(p+n)]) and sends v wei.\n 0xff is a 1 byte value, 'this' is the current contract's address as a 20 byte value and 's' is a big endian 256-bit value. it returns 0 on error.",
|
|
doc: "create2(v, p, n, s) new contract with code mem[p...(p+n)] at address keccak256(0xff . this . s . keccak256(mem[p...(p+n)]) and sends v wei.\n 0xff is a 1 byte value, 'this' is the current contract's address as a 20 byte value and 's' is a big endian 256-bit value. it returns 0 on error.",
|
|
|
ty: YulBuiltInFunction::Create2,
|
|
ty: YulBuiltInFunction::Create2,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "call",
|
|
name: "call",
|
|
@@ -681,6 +747,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "call(g, a, v, in, insize, out, outsize) calls contract at address a with input mem[in...(in+insize)] providing f cas and v wei and outputs area mem[out...(out+outsize)]. It returns 0 on error and 1 on success",
|
|
doc: "call(g, a, v, in, insize, out, outsize) calls contract at address a with input mem[in...(in+insize)] providing f cas and v wei and outputs area mem[out...(out+outsize)]. It returns 0 on error and 1 on success",
|
|
|
ty: YulBuiltInFunction::Call,
|
|
ty: YulBuiltInFunction::Call,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "callcode",
|
|
name: "callcode",
|
|
@@ -689,6 +756,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Identical to call(g, a, v, in, insize, out, outsize), but only use the code from a and stay in the context of the current contract otherwise",
|
|
doc: "Identical to call(g, a, v, in, insize, out, outsize), but only use the code from a and stay in the context of the current contract otherwise",
|
|
|
ty: YulBuiltInFunction::CallCode,
|
|
ty: YulBuiltInFunction::CallCode,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "delegatecall",
|
|
name: "delegatecall",
|
|
@@ -697,6 +765,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Identical to 'callcode' but also keep caller and callvalue",
|
|
doc: "Identical to 'callcode' but also keep caller and callvalue",
|
|
|
ty: YulBuiltInFunction::DelegateCall,
|
|
ty: YulBuiltInFunction::DelegateCall,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "staticcall",
|
|
name: "staticcall",
|
|
@@ -705,6 +774,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Identical to call(g, a, 0, in, insize, out, outsize), but do not allow state modifications",
|
|
doc: "Identical to call(g, a, 0, in, insize, out, outsize), but do not allow state modifications",
|
|
|
ty: YulBuiltInFunction::StaticCall,
|
|
ty: YulBuiltInFunction::StaticCall,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "return",
|
|
name: "return",
|
|
@@ -713,6 +783,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "return(p, s) ends execution and returns data mem[p...(p+s)]",
|
|
doc: "return(p, s) ends execution and returns data mem[p...(p+s)]",
|
|
|
ty: YulBuiltInFunction::Return,
|
|
ty: YulBuiltInFunction::Return,
|
|
|
stops_execution: true,
|
|
stops_execution: true,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "revert",
|
|
name: "revert",
|
|
@@ -721,6 +792,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "revert(p, s) ends execution, reverts state changes and returns data mem[p...(p+s)]",
|
|
doc: "revert(p, s) ends execution, reverts state changes and returns data mem[p...(p+s)]",
|
|
|
ty: YulBuiltInFunction::Revert,
|
|
ty: YulBuiltInFunction::Revert,
|
|
|
stops_execution: true,
|
|
stops_execution: true,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "selfdestruct",
|
|
name: "selfdestruct",
|
|
@@ -729,6 +801,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "selfdestruct(a) ends execution, destroy current contract and sends funds to a",
|
|
doc: "selfdestruct(a) ends execution, destroy current contract and sends funds to a",
|
|
|
ty: YulBuiltInFunction::SelfDestruct,
|
|
ty: YulBuiltInFunction::SelfDestruct,
|
|
|
stops_execution: true,
|
|
stops_execution: true,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "invalid",
|
|
name: "invalid",
|
|
@@ -737,6 +810,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Ends execution with invalid instruction",
|
|
doc: "Ends execution with invalid instruction",
|
|
|
ty: YulBuiltInFunction::Invalid,
|
|
ty: YulBuiltInFunction::Invalid,
|
|
|
stops_execution: true,
|
|
stops_execution: true,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "log0",
|
|
name: "log0",
|
|
@@ -745,6 +819,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "log(p, s): log without topics and data mem[p...(p+s)]",
|
|
doc: "log(p, s): log without topics and data mem[p...(p+s)]",
|
|
|
ty: YulBuiltInFunction::Log0,
|
|
ty: YulBuiltInFunction::Log0,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "log1",
|
|
name: "log1",
|
|
@@ -753,6 +828,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "log1(p, s, t1): log with topic t1 and data mem[p...(p+s)]",
|
|
doc: "log1(p, s, t1): log with topic t1 and data mem[p...(p+s)]",
|
|
|
ty: YulBuiltInFunction::Log1,
|
|
ty: YulBuiltInFunction::Log1,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "log2",
|
|
name: "log2",
|
|
@@ -761,6 +837,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "log2(p, s, t1, t2): log with topics t1, t2 and data mem[p...(p+s)]",
|
|
doc: "log2(p, s, t1, t2): log with topics t1, t2 and data mem[p...(p+s)]",
|
|
|
ty: YulBuiltInFunction::Log2,
|
|
ty: YulBuiltInFunction::Log2,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "log3",
|
|
name: "log3",
|
|
@@ -769,6 +846,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "log3(p, s, t1, t2, t3): log with topics t1, t2, t3 and data mem[p...(p+s)]",
|
|
doc: "log3(p, s, t1, t2, t3): log with topics t1, t2, t3 and data mem[p...(p+s)]",
|
|
|
ty: YulBuiltInFunction::Log3,
|
|
ty: YulBuiltInFunction::Log3,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "log4",
|
|
name: "log4",
|
|
@@ -777,6 +855,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "log4(p, s, t1, t2, t3, t4): log with topics t1, t2, t3, t4 with data mem[p...(p+s)]",
|
|
doc: "log4(p, s, t1, t2, t3, t4): log with topics t1, t2, t3, t4 with data mem[p...(p+s)]",
|
|
|
ty: YulBuiltInFunction::Log4,
|
|
ty: YulBuiltInFunction::Log4,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [false, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "chainid",
|
|
name: "chainid",
|
|
@@ -785,6 +864,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Returns the ID of the executing chain",
|
|
doc: "Returns the ID of the executing chain",
|
|
|
ty: YulBuiltInFunction::ChainId,
|
|
ty: YulBuiltInFunction::ChainId,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "basefee",
|
|
name: "basefee",
|
|
@@ -793,6 +873,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Return the current block's base fee",
|
|
doc: "Return the current block's base fee",
|
|
|
ty: YulBuiltInFunction::BaseFee,
|
|
ty: YulBuiltInFunction::BaseFee,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "origin",
|
|
name: "origin",
|
|
@@ -801,6 +882,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Returns the transaction sender",
|
|
doc: "Returns the transaction sender",
|
|
|
ty: YulBuiltInFunction::Origin,
|
|
ty: YulBuiltInFunction::Origin,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "gasprice",
|
|
name: "gasprice",
|
|
@@ -809,6 +891,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Returns the gas price of the transaction",
|
|
doc: "Returns the gas price of the transaction",
|
|
|
ty: YulBuiltInFunction::GasPrice,
|
|
ty: YulBuiltInFunction::GasPrice,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "blockhash",
|
|
name: "blockhash",
|
|
@@ -817,6 +900,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "blockhash(b) return the hash of block #b - only valid for the last 256 executing block excluding current",
|
|
doc: "blockhash(b) return the hash of block #b - only valid for the last 256 executing block excluding current",
|
|
|
ty: YulBuiltInFunction::BlockHash,
|
|
ty: YulBuiltInFunction::BlockHash,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "coinbase",
|
|
name: "coinbase",
|
|
@@ -825,6 +909,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Returns the current mining beneficiary",
|
|
doc: "Returns the current mining beneficiary",
|
|
|
ty: YulBuiltInFunction::CoinBase,
|
|
ty: YulBuiltInFunction::CoinBase,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "timestamp",
|
|
name: "timestamp",
|
|
@@ -833,6 +918,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Returns the timestamp of the current block in seconds since the epoch",
|
|
doc: "Returns the timestamp of the current block in seconds since the epoch",
|
|
|
ty: YulBuiltInFunction::Timestamp,
|
|
ty: YulBuiltInFunction::Timestamp,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "number",
|
|
name: "number",
|
|
@@ -841,6 +927,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Returns the current block's number",
|
|
doc: "Returns the current block's number",
|
|
|
ty: YulBuiltInFunction::Number,
|
|
ty: YulBuiltInFunction::Number,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, true, true],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "difficulty",
|
|
name: "difficulty",
|
|
@@ -849,6 +936,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Returns the difficulty of the current block",
|
|
doc: "Returns the difficulty of the current block",
|
|
|
ty: YulBuiltInFunction::Difficulty,
|
|
ty: YulBuiltInFunction::Difficulty,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, false, false],
|
|
|
},
|
|
},
|
|
|
YulBuiltinPrototype {
|
|
YulBuiltinPrototype {
|
|
|
name: "gaslimit",
|
|
name: "gaslimit",
|
|
@@ -857,6 +945,7 @@ static YUL_BUILTIN: [YulBuiltinPrototype; 76] =
|
|
|
doc: "Returns the current block's gas limit",
|
|
doc: "Returns the current block's gas limit",
|
|
|
ty: YulBuiltInFunction::GasLimit,
|
|
ty: YulBuiltInFunction::GasLimit,
|
|
|
stops_execution: false,
|
|
stops_execution: false,
|
|
|
|
|
+ availability: [true, false, false],
|
|
|
},
|
|
},
|
|
|
];
|
|
];
|
|
|
|
|
|