From 58907155a9d71575505d0281d00621f99fc33e24 Mon Sep 17 00:00:00 2001 From: francois Date: Fri, 18 Jul 2025 00:42:01 +0700 Subject: [PATCH 01/11] storage test passing --- crates/artifacts/vyper/src/ast/mod.rs | 399 ++++++++++++++++++++++ crates/artifacts/vyper/src/ast/visitor.rs | 0 crates/artifacts/vyper/src/lib.rs | 2 + test-data/vyper_ast/storage.json | 1 + 4 files changed, 402 insertions(+) create mode 100644 crates/artifacts/vyper/src/ast/mod.rs create mode 100644 crates/artifacts/vyper/src/ast/visitor.rs create mode 100644 test-data/vyper_ast/storage.json diff --git a/crates/artifacts/vyper/src/ast/mod.rs b/crates/artifacts/vyper/src/ast/mod.rs new file mode 100644 index 000000000..a673509c0 --- /dev/null +++ b/crates/artifacts/vyper/src/ast/mod.rs @@ -0,0 +1,399 @@ +use serde::{Deserialize, Serialize}; + +mod visitor; + +#[derive(Debug, Serialize, Deserialize)] +#[serde(tag = "ast_type")] +pub enum Node { + Module(Module), + Name(Name), + VariableDecl(VariableDecl), + AnnAssign(AnnAssign), + EventDef(EventDef), + FunctionDef(FunctionDef), + #[serde(rename = "arguments")] + Arguments(Arguments), + Assign(Assign), + Attribute(Attribute), + Assert(Assert), + Int(Int), + Str(Str), + Eq(Eq), + Gt(Gt), + Log(Log), + Return(Return), + #[serde(rename = "arg")] + Arg(Arg), + Compare(Compare), + Call(Call), + NotEq(NotEq), +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Module { + source_sha256sum: String, + name: Option, + path: String, + source_id: u64, + is_interface: bool, + doc_string: Option, + src: String, + body: Vec, + node_id: u64, + end_col_offset: u64, + col_offset: u64, + settings: Settings, + end_lineno: u64, + resolved_path: String, + lineno: u64, + #[serde(rename = "type")] + ttype: Type +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Settings {} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Name { + end_lineno: u64, + lineno: u64, + id: String, + col_offset: u64, + node_id: u64, + end_col_offset: u64, + src: String, + #[serde(rename = "type")] + ttype: Option, + variable_reads: Option> +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VariableDecl { + end_lineno: u64, + annotation: Box, + src: String, + value: Option, + col_offset: u64, + is_transient: bool, + is_constant: bool, + is_reentrant: bool, + is_public: bool, + node_id: u64, + target: Box, + end_col_offset: u64, + is_immutable: bool, + lineno: u64, + #[serde(rename = "type")] + ttype: Type +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct EventDef { + end_lineno: u64, + src: String, + col_offset: u64, + body: Vec, + node_id: u64, + doc_string: Option, + lineno: u64, + end_col_offset: u64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct FunctionDef { + end_lineno: u64, + src: String, + col_offset: u64, + args: Box, + body: Vec, + pos: Option, + node_id: u64, + doc_string: Option, + decorator_list: Vec, + name: String, + lineno: u64, + returns: Option>, + end_col_offset: u64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct AnnAssign { + end_lineno: u64, + annotation: Box, + src: String, + col_offset: u64, + value: Option>, + node_id: u64, + lineno: u64, + target: Box, + end_col_offset: u64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Arguments { + end_lineno: u64, + default: Option, + src: String, + col_offset: u64, + args: Vec, + node_id: u64, + lineno: u64, + defaults: Vec, + end_col_offset: u64 +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Assign { + end_lineno: u64, + src: String, + col_offset: u64, + value: Box, + node_id: u64, + lineno: u64, + target: Box, + end_col_offset: u64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Attribute { + end_lineno: u64, + src: String, + col_offset: u64, + value: Box, + node_id: u64, + attr: String, + lineno: u64, + end_col_offset: u64, + #[serde(rename = "type")] + ttype: Type, + variable_reads: Option>, + variable_writes: Option>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Assert { + end_lineno: u64, + lineno: u64, + col_offset: u64, + msg: Box, + node_id: u64, + test: Box, + end_col_offset: u64, + src: String +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Int { + end_lineno: u64, + lineno: u64, + col_offset: u64, + node_id: u64, + value: u64, + end_col_offset: u64, + src: String, + #[serde(rename = "type")] + ttype: Type +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Str { + end_lineno: u64, + lineno: u64, + col_offset: u64, + node_id: u64, + value: String, + end_col_offset: u64, + src: String, + #[serde(rename = "type")] + ttype: Type +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Eq { + end_lineno: u64, + lineno: u64, + col_offset: u64, + node_id: u64, + end_col_offset: u64, + src: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Gt { + end_lineno: u64, + lineno: u64, + col_offset: u64, + node_id: u64, + end_col_offset: u64, + src: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Log { + end_lineno: u64, + lineno: u64, + col_offset: u64, + node_id: u64, + end_col_offset: u64, + src: String, + #[serde(rename = "type")] + ttype: Type +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Return { + end_lineno: u64, + lineno: u64, + col_offset: u64, + node_id: u64, + end_col_offset: u64, + src: String, + value: Box, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Arg { + end_lineno: u64, + lineno: u64, + col_offset: u64, + node_id: u64, + end_col_offset: u64, + src: String, + annotation: Box, + arg: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Compare { + left: Box, + right: Box, + op: Box, + end_lineno: u64, + lineno: u64, + col_offset: u64, + node_id: u64, + end_col_offset: u64, + src: String, + #[serde(rename = "type")] + ttype: Type +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Call { + lineno: u64, + node_id: u64, + col_offset: u64, + args: Vec, + end_col_offset: u64, + end_lineno: u64, + src: String, + keywords: Vec, + func: Box, + #[serde(rename = "type")] + ttype: Type, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct NotEq { + lineno: u64, + node_id: u64, + col_offset: u64, + end_col_offset: u64, + end_lineno: u64, + src: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VariableAccess { + name: String, + decl_node: DeclNode, + access_path: Vec +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct DeclNode { + node_id: u64, + source_id: u64 +} + +#[derive(Debug, Serialize, Deserialize)] +// #[serde(rename_all = "snake_case", tag = "typeclass")] +pub struct Type { + pub name: Option, + pub typeclass: Option, + pub is_signed: Option, + pub bits: Option, + pub type_t: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TypedType { + pub name: String, + pub type_decl_node: Option, + pub typeclass: Option +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ModuleType { + name: String, + type_decl_node: TypeDeclNode, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct StringType { + length: u64, + name: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct BuiltinFunctionType { + name: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TypeDeclNode { + pub node_id: i64, + pub source_id: i64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct IntegerType { + is_signed: bool, + bits: u32, + name: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct EventType { + name: String, + type_decl_node: TypeDeclNode +} + +#[cfg(test)] +mod tests { + use super::*; + use std::{fs, path::Path}; + + #[test] + fn can_parse_ast() { + fs::read_dir(Path::new(env!("CARGO_MANIFEST_DIR")).join("../../../test-data").join("vyper_ast")) + .unwrap() + .for_each(|path| { + let path = path.unwrap().path(); + let path_str = path.to_string_lossy(); + + let input = fs::read_to_string(&path).unwrap(); + let deserializer = &mut serde_json::Deserializer::from_str(&input); + let result: Result = serde_path_to_error::deserialize(deserializer); + match result { + Err(e) => { + println!("... {path_str} fail: {e}"); + panic!(); + } + Ok(_) => { + println!("... {path_str} ok"); + } + } + }) + } +} \ No newline at end of file diff --git a/crates/artifacts/vyper/src/ast/visitor.rs b/crates/artifacts/vyper/src/ast/visitor.rs new file mode 100644 index 000000000..e69de29bb diff --git a/crates/artifacts/vyper/src/lib.rs b/crates/artifacts/vyper/src/lib.rs index 57d1f958c..98185a15e 100644 --- a/crates/artifacts/vyper/src/lib.rs +++ b/crates/artifacts/vyper/src/lib.rs @@ -13,4 +13,6 @@ mod input; pub use input::VyperInput; mod output; +mod ast; + pub use output::VyperOutput; diff --git a/test-data/vyper_ast/storage.json b/test-data/vyper_ast/storage.json new file mode 100644 index 000000000..a7103a80c --- /dev/null +++ b/test-data/vyper_ast/storage.json @@ -0,0 +1 @@ +{"source_sha256sum": "454ea2181abef802906d413a85e1a6d1219ac3ab4c3cb78200e982382fbfae66", "is_interface": false, "body": [{"end_col_offset": 29, "lineno": 4, "end_lineno": 4, "value": null, "ast_type": "VariableDecl", "is_transient": false, "annotation": {"end_col_offset": 28, "lineno": 4, "end_lineno": 4, "id": "uint256", "ast_type": "Name", "col_offset": 21, "node_id": 7, "src": "54:7:0"}, "is_constant": false, "is_reentrant": false, "node_id": 1, "is_immutable": false, "col_offset": 0, "is_public": true, "src": "33:29:0", "target": {"end_col_offset": 12, "lineno": 4, "end_lineno": 4, "id": "stored_value", "ast_type": "Name", "col_offset": 0, "node_id": 2, "src": "33:12:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, {"end_col_offset": 22, "lineno": 5, "end_lineno": 5, "value": null, "ast_type": "VariableDecl", "is_transient": false, "annotation": {"end_col_offset": 21, "lineno": 5, "end_lineno": 5, "id": "address", "ast_type": "Name", "col_offset": 14, "node_id": 15, "src": "77:7:0"}, "is_constant": false, "is_reentrant": false, "node_id": 9, "is_immutable": false, "col_offset": 0, "is_public": true, "src": "63:22:0", "target": {"end_col_offset": 5, "lineno": 5, "end_lineno": 5, "id": "owner", "ast_type": "Name", "col_offset": 0, "node_id": 10, "src": "63:5:0", "type": {"name": "address"}}, "type": {"name": "address"}}, {"body": [{"end_col_offset": 22, "lineno": 8, "end_lineno": 8, "value": null, "ast_type": "AnnAssign", "annotation": {"end_col_offset": 22, "lineno": 8, "end_lineno": 8, "id": "uint256", "ast_type": "Name", "col_offset": 15, "node_id": 21, "src": "122:7:0"}, "col_offset": 4, "node_id": 18, "src": "111:18:0", "target": {"end_col_offset": 13, "lineno": 8, "end_lineno": 8, "id": "old_value", "ast_type": "Name", "col_offset": 4, "node_id": 19, "src": "111:9:0"}}, {"end_col_offset": 22, "lineno": 9, "end_lineno": 9, "value": null, "ast_type": "AnnAssign", "annotation": {"end_col_offset": 22, "lineno": 9, "end_lineno": 9, "id": "uint256", "ast_type": "Name", "col_offset": 15, "node_id": 26, "src": "145:7:0"}, "col_offset": 4, "node_id": 23, "src": "134:18:0", "target": {"end_col_offset": 13, "lineno": 9, "end_lineno": 9, "id": "new_value", "ast_type": "Name", "col_offset": 4, "node_id": 24, "src": "134:9:0"}}], "end_col_offset": 22, "lineno": 7, "end_lineno": 9, "ast_type": "EventDef", "col_offset": 0, "doc_string": null, "node_id": 17, "name": "ValueChanged", "src": "87:65:0"}, {"body": [{"end_col_offset": 27, "lineno": 13, "end_lineno": 13, "value": {"end_col_offset": 27, "lineno": 13, "end_lineno": 13, "value": {"end_col_offset": 20, "lineno": 13, "end_lineno": 13, "id": "msg", "ast_type": "Name", "col_offset": 17, "node_id": 36, "src": "195:3:0", "type": {"name": "msg"}}, "ast_type": "Attribute", "col_offset": 17, "node_id": 35, "src": "195:10:0", "attr": "sender", "type": {"name": "address"}}, "ast_type": "Assign", "col_offset": 4, "node_id": 30, "src": "182:23:0", "target": {"end_col_offset": 14, "lineno": 13, "end_lineno": 13, "value": {"end_col_offset": 8, "lineno": 13, "end_lineno": 13, "id": "self", "ast_type": "Name", "col_offset": 4, "node_id": 32, "src": "182:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 4, "node_id": 31, "src": "182:10:0", "attr": "owner", "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 9, "source_id": 0}, "access_path": []}], "variable_writes": [{"name": "owner", "decl_node": {"node_id": 9, "source_id": 0}, "access_path": []}]}}, {"end_col_offset": 26, "lineno": 14, "end_lineno": 14, "value": {"end_col_offset": 26, "lineno": 14, "end_lineno": 14, "value": 42, "ast_type": "Int", "col_offset": 24, "node_id": 44, "src": "230:2:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "ast_type": "Assign", "col_offset": 4, "node_id": 39, "src": "210:22:0", "target": {"end_col_offset": 21, "lineno": 14, "end_lineno": 14, "value": {"end_col_offset": 8, "lineno": 14, "end_lineno": 14, "id": "self", "ast_type": "Name", "col_offset": 4, "node_id": 41, "src": "210:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 4, "node_id": 40, "src": "210:17:0", "attr": "stored_value", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "stored_value", "decl_node": {"node_id": 1, "source_id": 0}, "access_path": []}], "variable_writes": [{"name": "stored_value", "decl_node": {"node_id": 1, "source_id": 0}, "access_path": []}]}}], "end_col_offset": 26, "lineno": 12, "returns": null, "end_lineno": 14, "args": {"defaults": [], "end_col_offset": 26, "lineno": 12, "end_lineno": 14, "args": [], "ast_type": "arguments", "col_offset": 0, "node_id": 29, "default": null, "src": "162:70:0"}, "ast_type": "FunctionDef", "col_offset": 0, "doc_string": null, "node_id": 28, "name": "__init__", "pos": null, "decorator_list": [{"end_col_offset": 7, "lineno": 11, "end_lineno": 11, "id": "deploy", "ast_type": "Name", "col_offset": 1, "node_id": 45, "src": "155:6:0"}], "src": "162:70:0"}, {"body": [{"end_col_offset": 61, "msg": {"end_col_offset": 61, "lineno": 18, "end_lineno": 18, "value": "Only owner can set val", "ast_type": "Str", "col_offset": 37, "node_id": 63, "src": "310:24:0", "type": {"length": 22, "name": "String", "typeclass": "string"}}, "lineno": 18, "end_lineno": 18, "ast_type": "Assert", "test": {"end_col_offset": 35, "lineno": 18, "right": {"end_col_offset": 35, "lineno": 18, "end_lineno": 18, "value": {"end_col_offset": 29, "lineno": 18, "end_lineno": 18, "id": "self", "ast_type": "Name", "col_offset": 25, "node_id": 60, "src": "298:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 25, "node_id": 59, "src": "298:10:0", "attr": "owner", "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 9, "source_id": 0}, "access_path": []}]}, "end_lineno": 18, "ast_type": "Compare", "col_offset": 11, "node_id": 53, "src": "284:24:0", "left": {"end_col_offset": 21, "lineno": 18, "end_lineno": 18, "value": {"end_col_offset": 14, "lineno": 18, "end_lineno": 18, "id": "msg", "ast_type": "Name", "col_offset": 11, "node_id": 55, "src": "284:3:0", "type": {"name": "msg"}}, "ast_type": "Attribute", "col_offset": 11, "node_id": 54, "src": "284:10:0", "attr": "sender", "type": {"name": "address"}}, "op": {"end_col_offset": 35, "lineno": 18, "end_lineno": 18, "ast_type": "Eq", "col_offset": 11, "node_id": 124, "src": "284:24:0"}, "type": {"name": "bool"}}, "col_offset": 4, "node_id": 52, "src": "277:57:0"}, {"end_col_offset": 44, "msg": {"end_col_offset": 44, "lineno": 19, "end_lineno": 19, "value": "Value must be positive", "ast_type": "Str", "col_offset": 20, "node_id": 70, "src": "355:24:0", "type": {"length": 22, "name": "String", "typeclass": "string"}}, "lineno": 19, "end_lineno": 19, "ast_type": "Assert", "test": {"end_col_offset": 18, "lineno": 19, "right": {"end_col_offset": 18, "lineno": 19, "end_lineno": 19, "value": 0, "ast_type": "Int", "col_offset": 17, "node_id": 69, "src": "352:1:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "end_lineno": 19, "ast_type": "Compare", "col_offset": 11, "node_id": 65, "src": "346:7:0", "left": {"end_col_offset": 14, "lineno": 19, "end_lineno": 19, "id": "val", "ast_type": "Name", "col_offset": 11, "node_id": 66, "src": "346:3:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "val", "decl_node": {"node_id": 49, "source_id": 0}, "access_path": []}]}, "op": {"end_col_offset": 18, "lineno": 19, "end_lineno": 19, "ast_type": "Gt", "col_offset": 11, "node_id": 68, "src": "346:7:0"}, "type": {"name": "bool"}}, "col_offset": 4, "node_id": 64, "src": "339:40:0"}, {"end_col_offset": 42, "lineno": 21, "end_lineno": 21, "value": {"end_col_offset": 42, "lineno": 21, "end_lineno": 21, "value": {"end_col_offset": 29, "lineno": 21, "end_lineno": 21, "id": "self", "ast_type": "Name", "col_offset": 25, "node_id": 77, "src": "406:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 25, "node_id": 76, "src": "406:17:0", "attr": "stored_value", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "stored_value", "decl_node": {"node_id": 1, "source_id": 0}, "access_path": []}]}, "ast_type": "AnnAssign", "annotation": {"end_col_offset": 22, "lineno": 21, "end_lineno": 21, "id": "uint256", "ast_type": "Name", "col_offset": 15, "node_id": 74, "src": "396:7:0"}, "col_offset": 4, "node_id": 71, "src": "385:38:0", "target": {"end_col_offset": 13, "lineno": 21, "end_lineno": 21, "id": "old_value", "ast_type": "Name", "col_offset": 4, "node_id": 72, "src": "385:9:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "old_value", "decl_node": {"node_id": 71, "source_id": 0}, "access_path": []}]}}, {"end_col_offset": 27, "lineno": 22, "end_lineno": 22, "value": {"end_col_offset": 27, "lineno": 22, "end_lineno": 22, "id": "val", "ast_type": "Name", "col_offset": 24, "node_id": 85, "src": "448:3:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "val", "decl_node": {"node_id": 49, "source_id": 0}, "access_path": []}]}, "ast_type": "Assign", "col_offset": 4, "node_id": 80, "src": "428:23:0", "target": {"end_col_offset": 21, "lineno": 22, "end_lineno": 22, "value": {"end_col_offset": 8, "lineno": 22, "end_lineno": 22, "id": "self", "ast_type": "Name", "col_offset": 4, "node_id": 82, "src": "428:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 4, "node_id": 81, "src": "428:17:0", "attr": "stored_value", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "stored_value", "decl_node": {"node_id": 1, "source_id": 0}, "access_path": []}], "variable_writes": [{"name": "stored_value", "decl_node": {"node_id": 1, "source_id": 0}, "access_path": []}]}}, {"end_col_offset": 56, "lineno": 24, "end_lineno": 24, "value": {"end_col_offset": 56, "lineno": 24, "end_lineno": 24, "args": [], "ast_type": "Call", "col_offset": 8, "func": {"end_col_offset": 20, "lineno": 24, "end_lineno": 24, "id": "ValueChanged", "ast_type": "Name", "col_offset": 8, "node_id": 90, "src": "461:12:0", "type": {"type_t": {"name": "ValueChanged", "type_decl_node": {"node_id": 17, "source_id": 0}, "typeclass": "event"}}}, "node_id": 89, "src": "461:48:0", "keywords": [{"end_col_offset": 40, "lineno": 24, "end_lineno": 24, "value": {"end_col_offset": 40, "lineno": 24, "end_lineno": 24, "id": "old_value", "ast_type": "Name", "col_offset": 31, "node_id": 93, "src": "484:9:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "old_value", "decl_node": {"node_id": 71, "source_id": 0}, "access_path": []}]}, "ast_type": "keyword", "col_offset": 21, "node_id": 92, "arg": "old_value", "src": "474:19:0"}, {"end_col_offset": 55, "lineno": 24, "end_lineno": 24, "value": {"end_col_offset": 55, "lineno": 24, "end_lineno": 24, "id": "val", "ast_type": "Name", "col_offset": 52, "node_id": 96, "src": "505:3:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "val", "decl_node": {"node_id": 49, "source_id": 0}, "access_path": []}]}, "ast_type": "keyword", "col_offset": 42, "node_id": 95, "arg": "new_value", "src": "495:13:0"}], "type": {"name": "(void)"}}, "ast_type": "Log", "col_offset": 4, "node_id": 88, "src": "457:52:0", "type": {"name": "ValueChanged", "type_decl_node": {"node_id": 17, "source_id": 0}, "typeclass": "event"}}], "end_col_offset": 56, "lineno": 17, "returns": null, "end_lineno": 24, "args": {"defaults": [], "end_col_offset": 56, "lineno": 17, "end_lineno": 24, "args": [{"end_col_offset": 26, "lineno": 17, "end_lineno": 17, "ast_type": "arg", "col_offset": 14, "annotation": {"end_col_offset": 26, "lineno": 17, "end_lineno": 17, "id": "uint256", "ast_type": "Name", "col_offset": 19, "node_id": 50, "src": "263:7:0"}, "node_id": 49, "arg": "val", "src": "258:12:0"}], "ast_type": "arguments", "col_offset": 0, "node_id": 48, "default": null, "src": "244:265:0"}, "ast_type": "FunctionDef", "col_offset": 0, "doc_string": null, "node_id": 47, "name": "set_value", "pos": null, "decorator_list": [{"end_col_offset": 9, "lineno": 16, "end_lineno": 16, "id": "external", "ast_type": "Name", "col_offset": 1, "node_id": 98, "src": "235:8:0"}], "src": "244:265:0"}, {"body": [{"end_col_offset": 28, "lineno": 29, "end_lineno": 29, "value": {"end_col_offset": 28, "lineno": 29, "end_lineno": 29, "value": {"end_col_offset": 15, "lineno": 29, "end_lineno": 29, "id": "self", "ast_type": "Name", "col_offset": 11, "node_id": 104, "src": "566:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 11, "node_id": 103, "src": "566:17:0", "attr": "stored_value", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "stored_value", "decl_node": {"node_id": 1, "source_id": 0}, "access_path": []}]}, "ast_type": "Return", "col_offset": 4, "node_id": 102, "src": "559:24:0"}], "end_col_offset": 28, "lineno": 28, "returns": {"end_col_offset": 26, "lineno": 28, "end_lineno": 28, "id": "uint256", "ast_type": "Name", "col_offset": 19, "node_id": 111, "src": "546:7:0"}, "end_lineno": 29, "args": {"defaults": [], "end_col_offset": 28, "lineno": 28, "end_lineno": 29, "args": [], "ast_type": "arguments", "col_offset": 0, "node_id": 101, "default": null, "src": "527:56:0"}, "ast_type": "FunctionDef", "col_offset": 0, "doc_string": null, "node_id": 100, "name": "get_value", "pos": null, "decorator_list": [{"end_col_offset": 9, "lineno": 26, "end_lineno": 26, "id": "external", "ast_type": "Name", "col_offset": 1, "node_id": 107, "src": "512:8:0"}, {"end_col_offset": 5, "lineno": 27, "end_lineno": 27, "id": "view", "ast_type": "Name", "col_offset": 1, "node_id": 109, "src": "522:4:0"}], "src": "527:56:0"}, {"body": [{"end_col_offset": 72, "msg": {"end_col_offset": 72, "lineno": 33, "end_lineno": 33, "value": "Only owner can transfer ownership", "ast_type": "Str", "col_offset": 37, "node_id": 129, "src": "676:35:0", "type": {"length": 33, "name": "String", "typeclass": "string"}}, "lineno": 33, "end_lineno": 33, "ast_type": "Assert", "test": {"end_col_offset": 35, "lineno": 33, "right": {"end_col_offset": 35, "lineno": 33, "end_lineno": 33, "value": {"end_col_offset": 29, "lineno": 33, "end_lineno": 33, "id": "self", "ast_type": "Name", "col_offset": 25, "node_id": 126, "src": "664:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 25, "node_id": 125, "src": "664:10:0", "attr": "owner", "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 9, "source_id": 0}, "access_path": []}]}, "end_lineno": 33, "ast_type": "Compare", "col_offset": 11, "node_id": 119, "src": "650:24:0", "left": {"end_col_offset": 21, "lineno": 33, "end_lineno": 33, "value": {"end_col_offset": 14, "lineno": 33, "end_lineno": 33, "id": "msg", "ast_type": "Name", "col_offset": 11, "node_id": 121, "src": "650:3:0", "type": {"name": "msg"}}, "ast_type": "Attribute", "col_offset": 11, "node_id": 120, "src": "650:10:0", "attr": "sender", "type": {"name": "address"}}, "op": {"end_col_offset": 35, "lineno": 18, "end_lineno": 18, "ast_type": "Eq", "col_offset": 11, "node_id": 124, "src": "284:24:0"}, "type": {"name": "bool"}}, "col_offset": 4, "node_id": 118, "src": "643:68:0"}, {"end_col_offset": 74, "msg": {"end_col_offset": 74, "lineno": 34, "end_lineno": 34, "value": "New owner cannot be zero address", "ast_type": "Str", "col_offset": 40, "node_id": 140, "src": "752:34:0", "type": {"length": 32, "name": "String", "typeclass": "string"}}, "lineno": 34, "end_lineno": 34, "ast_type": "Assert", "test": {"end_col_offset": 38, "lineno": 34, "right": {"end_col_offset": 38, "lineno": 34, "end_lineno": 34, "args": [{"end_col_offset": 37, "lineno": 34, "end_lineno": 34, "id": "address", "ast_type": "Name", "col_offset": 30, "node_id": 138, "src": "742:7:0", "type": {"type_t": {"name": "address"}}}], "ast_type": "Call", "col_offset": 24, "func": {"end_col_offset": 29, "lineno": 34, "end_lineno": 34, "id": "empty", "ast_type": "Name", "col_offset": 24, "node_id": 136, "src": "736:5:0", "type": {"name": "empty", "typeclass": "builtin_function"}}, "node_id": 135, "src": "736:14:0", "keywords": [], "type": {"name": "address"}}, "end_lineno": 34, "ast_type": "Compare", "col_offset": 11, "node_id": 131, "src": "723:27:0", "left": {"end_col_offset": 20, "lineno": 34, "end_lineno": 34, "id": "new_owner", "ast_type": "Name", "col_offset": 11, "node_id": 132, "src": "723:9:0", "type": {"name": "address"}, "variable_reads": [{"name": "new_owner", "decl_node": {"node_id": 115, "source_id": 0}, "access_path": []}]}, "op": {"end_col_offset": 38, "lineno": 34, "end_lineno": 34, "ast_type": "NotEq", "col_offset": 11, "node_id": 134, "src": "723:27:0"}, "type": {"name": "bool"}}, "col_offset": 4, "node_id": 130, "src": "716:70:0"}, {"end_col_offset": 26, "lineno": 36, "end_lineno": 36, "value": {"end_col_offset": 26, "lineno": 36, "end_lineno": 36, "id": "new_owner", "ast_type": "Name", "col_offset": 17, "node_id": 146, "src": "805:9:0", "type": {"name": "address"}, "variable_reads": [{"name": "new_owner", "decl_node": {"node_id": 115, "source_id": 0}, "access_path": []}]}, "ast_type": "Assign", "col_offset": 4, "node_id": 141, "src": "792:22:0", "target": {"end_col_offset": 14, "lineno": 36, "end_lineno": 36, "value": {"end_col_offset": 8, "lineno": 36, "end_lineno": 36, "id": "self", "ast_type": "Name", "col_offset": 4, "node_id": 143, "src": "792:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 4, "node_id": 142, "src": "792:10:0", "attr": "owner", "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 9, "source_id": 0}, "access_path": []}], "variable_writes": [{"name": "owner", "decl_node": {"node_id": 9, "source_id": 0}, "access_path": []}]}}], "end_col_offset": 26, "lineno": 32, "returns": null, "end_lineno": 36, "args": {"defaults": [], "end_col_offset": 26, "lineno": 32, "end_lineno": 36, "args": [{"end_col_offset": 41, "lineno": 32, "end_lineno": 32, "ast_type": "arg", "col_offset": 23, "annotation": {"end_col_offset": 41, "lineno": 32, "end_lineno": 32, "id": "address", "ast_type": "Name", "col_offset": 34, "node_id": 116, "src": "629:7:0"}, "node_id": 115, "arg": "new_owner", "src": "618:18:0"}], "ast_type": "arguments", "col_offset": 0, "node_id": 114, "default": null, "src": "595:219:0"}, "ast_type": "FunctionDef", "col_offset": 0, "doc_string": null, "node_id": 113, "name": "transfer_ownership", "pos": null, "decorator_list": [{"end_col_offset": 9, "lineno": 31, "end_lineno": 31, "id": "external", "ast_type": "Name", "col_offset": 1, "node_id": 148, "src": "586:8:0"}], "src": "595:219:0"}], "end_col_offset": 27, "path": "src/Storage.vy", "resolved_path": "/home/francois/tmp/equivalent/src/Storage.vy", "end_lineno": 36, "lineno": 1, "ast_type": "Module", "col_offset": 0, "doc_string": null, "node_id": 0, "name": null, "settings": {}, "src": "0:815:0", "source_id": 0, "type": {"name": "src/Storage.vy", "type_decl_node": {"node_id": 0, "source_id": 0}, "typeclass": "module"}} \ No newline at end of file From 0362244b71e5a095ec77a69f443f510dfb999ab3 Mon Sep 17 00:00:00 2001 From: francois Date: Sat, 19 Jul 2025 12:39:27 +0700 Subject: [PATCH 02/11] Use macros for code dryness --- crates/artifacts/vyper/src/ast/macros.rs | 49 ++ crates/artifacts/vyper/src/ast/mod.rs | 761 ++++++++++++---------- crates/artifacts/vyper/src/ast/visitor.rs | 1 + crates/artifacts/vyper/src/lib.rs | 5 +- 4 files changed, 479 insertions(+), 337 deletions(-) create mode 100644 crates/artifacts/vyper/src/ast/macros.rs diff --git a/crates/artifacts/vyper/src/ast/macros.rs b/crates/artifacts/vyper/src/ast/macros.rs new file mode 100644 index 000000000..0be041767 --- /dev/null +++ b/crates/artifacts/vyper/src/ast/macros.rs @@ -0,0 +1,49 @@ +macro_rules! vyper_node { + ( + $(#[$struct_meta:meta])* + struct $name:ident { + $( + $(#[$field_meta:meta])* + $field:ident: $ty:ty + ),* $(,)? + } + ) => { + $(#[$struct_meta])* + #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] + pub struct $name { + pub node_id: u64, + pub src: String, + pub lineno: u64, + pub col_offset: u64, + pub end_lineno: u64, + pub end_col_offset: u64, + $( + $(#[$field_meta])* + pub $field: $ty + ),* + } + }; +} + +macro_rules! node_group { + ( + $group:ident; + + $( + $(#[$field_meta:meta])? + $name:ident + ),* $(,)? + ) => { + #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] + #[serde(tag = "ast_type")] + pub enum $group { + $( + $(#[$field_meta])* + $name($name), + )* + } + }; +} + +pub(crate) use vyper_node; +pub(crate) use node_group; diff --git a/crates/artifacts/vyper/src/ast/mod.rs b/crates/artifacts/vyper/src/ast/mod.rs index a673509c0..65834bd3b 100644 --- a/crates/artifacts/vyper/src/ast/mod.rs +++ b/crates/artifacts/vyper/src/ast/mod.rs @@ -1,322 +1,441 @@ use serde::{Deserialize, Serialize}; -mod visitor; +pub mod visitor; +mod macros; + +use macros::{vyper_node}; +use crate::ast::macros::node_group; + +vyper_node!( + struct Module { + // Module-specific fields + source_sha256sum: String, + name: Option, + path: String, + resolved_path: String, + source_id: u64, + is_interface: bool, + doc_string: Option, + settings: Settings, + + // AST content + body: Vec, + } +); + +node_group!( + TopLevelItem; + + // Function definitions + FunctionDef, + + // Variable declarations + VariableDecl, + + // Type definitions + StructDef, + EventDef, + FlagDef, + InterfaceDef, + + // Import statements + Import, + ImportFrom, + + // Special declarations + ImplementsDecl, + UsesDecl, + InitializesDecl, + ExportsDecl, + + // Docstrings at top level + DocStr, +); + +vyper_node!( + struct FunctionDef { + args: Arguments, + body: Vec, + pos: Option, + doc_string: Option, + decorator_list: Vec, + name: String, + returns: Option>, + } +); + +vyper_node!( + struct VariableDecl { + annotation: Box, + value: Option, + is_transient: bool, + is_constant: bool, + is_reentrant: bool, + is_public: bool, + target: Box, + is_immutable: bool, + #[serde(rename = "type")] + ttype: Type, + } +); -#[derive(Debug, Serialize, Deserialize)] -#[serde(tag = "ast_type")] -pub enum Node { - Module(Module), - Name(Name), - VariableDecl(VariableDecl), - AnnAssign(AnnAssign), - EventDef(EventDef), - FunctionDef(FunctionDef), - #[serde(rename = "arguments")] - Arguments(Arguments), - Assign(Assign), - Attribute(Attribute), - Assert(Assert), - Int(Int), - Str(Str), - Eq(Eq), - Gt(Gt), - Log(Log), - Return(Return), +vyper_node!(struct StructDef {}); + +vyper_node!( + struct EventDef { + name: String, + body: Vec, + doc_string: Option, + } +); + +vyper_node!(struct FlagDef {}); + +vyper_node!(struct InterfaceDef {}); + +vyper_node!(struct Import {}); + +vyper_node!(struct ImportFrom {}); + +vyper_node!(struct ImplementsDecl {}); + +vyper_node!(struct UsesDecl {}); + +vyper_node!(struct InitializesDecl {}); + +vyper_node!(struct ExportsDecl {}); + +vyper_node!(struct DocStr {}); + +node_group!( + Statement; + + // Assignment statements + Assign, + AnnAssign, + AugAssign, + + // Control flow statements + Return, + If, + For, + Break, + Continue, + Pass, + + // Exception handling + Raise, + Assert, + + // Vyper-specific statements + Log, + + // Expression statements + Expr, + NamedExpr, +); + +vyper_node!( + struct Assign { + value: Box, + target: Box, + } +); + +vyper_node!( + struct AnnAssign { + annotation: Box, + value: Option>, + target: Box, + } +); + +vyper_node!(struct AugAssign {}); + +vyper_node!( + struct Return { + value: Option>, + } +); + +vyper_node!(struct If {}); + +vyper_node!(struct For {}); + +vyper_node!(struct Break {}); + +vyper_node!(struct Continue {}); + +vyper_node!(struct Pass {}); + +vyper_node!(struct Raise {}); + +vyper_node!( + struct Assert { + msg: Box, + test: Box, + } +); + +vyper_node!( + struct Log { + #[serde(rename = "type")] + ttype: Type, + } +); + +vyper_node!(struct Expr {}); + +vyper_node!(struct NamedExpr {}); + +node_group!( + Expression; + + // Literals + Constant, + Int, + Decimal, + Hex, + Str, + Bytes, + HexBytes, + NameConstant, + Ellipsis, + + // Collections + List, + Tuple, + Dict, + + // Names and access + Name, + Attribute, + Subscript, + + // Operations + UnaryOp, + BinOp, + BoolOp, + Compare, + + // Function calls + Call, + ExtCall, + StaticCall, + + // Control flow expressions + IfExp, + + // Function parameters (special context) #[serde(rename = "arg")] - Arg(Arg), - Compare(Compare), - Call(Call), - NotEq(NotEq), -} + Arg, + #[serde(rename = "arguments")] + Arguments, + #[serde(rename = "keyword")] + Keyword, +); + +vyper_node!(struct Constant {}); // TODO + +vyper_node!( + struct Int { + value: u64, + #[serde(rename = "type")] + ttype: Type, + } +); -#[derive(Debug, Serialize, Deserialize)] -pub struct Module { - source_sha256sum: String, - name: Option, - path: String, - source_id: u64, - is_interface: bool, - doc_string: Option, - src: String, - body: Vec, - node_id: u64, - end_col_offset: u64, - col_offset: u64, - settings: Settings, - end_lineno: u64, - resolved_path: String, - lineno: u64, - #[serde(rename = "type")] - ttype: Type -} +vyper_node!(struct Decimal {}); // TODO -#[derive(Debug, Serialize, Deserialize)] -pub struct Settings {} +vyper_node!(struct Hex {}); // TODO -#[derive(Debug, Serialize, Deserialize)] -pub struct Name { - end_lineno: u64, - lineno: u64, - id: String, - col_offset: u64, - node_id: u64, - end_col_offset: u64, - src: String, - #[serde(rename = "type")] - ttype: Option, - variable_reads: Option> -} +vyper_node!( + struct Str { + value: String, + #[serde(rename = "type")] + ttype: Type, + } +); -#[derive(Debug, Serialize, Deserialize)] -pub struct VariableDecl { - end_lineno: u64, - annotation: Box, - src: String, - value: Option, - col_offset: u64, - is_transient: bool, - is_constant: bool, - is_reentrant: bool, - is_public: bool, - node_id: u64, - target: Box, - end_col_offset: u64, - is_immutable: bool, - lineno: u64, - #[serde(rename = "type")] - ttype: Type -} +vyper_node!(struct Bytes {}); // TODO -#[derive(Debug, Serialize, Deserialize)] -pub struct EventDef { - end_lineno: u64, - src: String, - col_offset: u64, - body: Vec, - node_id: u64, - doc_string: Option, - lineno: u64, - end_col_offset: u64, -} +vyper_node!(struct HexBytes {}); // TODO -#[derive(Debug, Serialize, Deserialize)] -pub struct FunctionDef { - end_lineno: u64, - src: String, - col_offset: u64, - args: Box, - body: Vec, - pos: Option, - node_id: u64, - doc_string: Option, - decorator_list: Vec, - name: String, - lineno: u64, - returns: Option>, - end_col_offset: u64, -} +vyper_node!(struct NameConstant {}); // TODO -#[derive(Debug, Serialize, Deserialize)] -pub struct AnnAssign { - end_lineno: u64, - annotation: Box, - src: String, - col_offset: u64, - value: Option>, - node_id: u64, - lineno: u64, - target: Box, - end_col_offset: u64, -} +vyper_node!(struct Ellipsis {}); // TODO -#[derive(Debug, Serialize, Deserialize)] -pub struct Arguments { - end_lineno: u64, - default: Option, - src: String, - col_offset: u64, - args: Vec, - node_id: u64, - lineno: u64, - defaults: Vec, - end_col_offset: u64 -} +vyper_node!(struct List {}); // TODO -#[derive(Debug, Serialize, Deserialize)] -pub struct Assign { - end_lineno: u64, - src: String, - col_offset: u64, - value: Box, - node_id: u64, - lineno: u64, - target: Box, - end_col_offset: u64, -} +vyper_node!(struct Tuple {}); // TODO -#[derive(Debug, Serialize, Deserialize)] -pub struct Attribute { - end_lineno: u64, - src: String, - col_offset: u64, - value: Box, - node_id: u64, - attr: String, - lineno: u64, - end_col_offset: u64, - #[serde(rename = "type")] - ttype: Type, - variable_reads: Option>, - variable_writes: Option>, -} +vyper_node!(struct Dict {}); // TODO -#[derive(Debug, Serialize, Deserialize)] -pub struct Assert { - end_lineno: u64, - lineno: u64, - col_offset: u64, - msg: Box, - node_id: u64, - test: Box, - end_col_offset: u64, - src: String -} +vyper_node!( + struct Name { + id: String, + #[serde(rename = "type")] + ttype: Option, + variable_reads: Option>, + } +); + +vyper_node!( + struct Attribute { + value: Box, + attr: String, + #[serde(rename = "type")] + ttype: Type, + variable_reads: Option>, + variable_writes: Option>, + } +); -#[derive(Debug, Serialize, Deserialize)] -pub struct Int { - end_lineno: u64, - lineno: u64, - col_offset: u64, - node_id: u64, - value: u64, - end_col_offset: u64, - src: String, - #[serde(rename = "type")] - ttype: Type -} +vyper_node!(struct Subscript {}); // TODO -#[derive(Debug, Serialize, Deserialize)] -pub struct Str { - end_lineno: u64, - lineno: u64, - col_offset: u64, - node_id: u64, - value: String, - end_col_offset: u64, - src: String, - #[serde(rename = "type")] - ttype: Type -} +vyper_node!(struct UnaryOp {}); // TODO -#[derive(Debug, Serialize, Deserialize)] -pub struct Eq { - end_lineno: u64, - lineno: u64, - col_offset: u64, - node_id: u64, - end_col_offset: u64, - src: String, -} +vyper_node!(struct BinOp {}); // TODO -#[derive(Debug, Serialize, Deserialize)] -pub struct Gt { - end_lineno: u64, - lineno: u64, - col_offset: u64, - node_id: u64, - end_col_offset: u64, - src: String, -} +vyper_node!(struct BoolOp {}); // TODO -#[derive(Debug, Serialize, Deserialize)] -pub struct Log { - end_lineno: u64, - lineno: u64, - col_offset: u64, - node_id: u64, - end_col_offset: u64, - src: String, - #[serde(rename = "type")] - ttype: Type -} +vyper_node!( + struct Compare { + left: Box, + right: Box, + op: Box, + #[serde(rename = "type")] + ttype: Type, + } +); + +vyper_node!( + struct Call { + args: Vec, + keywords: Vec, + func: Box, + #[serde(rename = "type")] + ttype: Type, + } +); -#[derive(Debug, Serialize, Deserialize)] -pub struct Return { - end_lineno: u64, - lineno: u64, - col_offset: u64, - node_id: u64, - end_col_offset: u64, - src: String, - value: Box, -} +vyper_node!(struct ExtCall {}); // TODO + +vyper_node!(struct StaticCall {}); // TODO + +vyper_node!(struct IfExp {}); // TODO -#[derive(Debug, Serialize, Deserialize)] -pub struct Arg { - end_lineno: u64, - lineno: u64, - col_offset: u64, - node_id: u64, - end_col_offset: u64, - src: String, - annotation: Box, - arg: String, +vyper_node!( + struct Arg { + annotation: Box, + arg: String, + } +); + +vyper_node!( + struct Arguments { + default: Option, + args: Vec, + defaults: Vec, + } +); + +vyper_node!(struct Keyword {}); // TODO + +#[derive(Debug, Serialize, Deserialize, Clone)] +#[serde(tag = "ast_type")] +pub enum UnaryOperator { + USub(USub), + Not(Not), + Invert(Invert), } -#[derive(Debug, Serialize, Deserialize)] -pub struct Compare { - left: Box, - right: Box, - op: Box, - end_lineno: u64, - lineno: u64, - col_offset: u64, - node_id: u64, - end_col_offset: u64, - src: String, - #[serde(rename = "type")] - ttype: Type +vyper_node!(struct USub {}); // TODO +vyper_node!(struct Not {}); // TODO +vyper_node!(struct Invert {}); // TODO + +#[derive(Debug, Serialize, Deserialize, Clone)] +#[serde(tag = "ast_type")] +pub enum BinaryOperator { + // Arithmetic + Add(Add), + Sub(Sub), + Mult(Mult), + Div(Div), + FloorDiv(FloorDiv), + Mod(Mod), + Pow(Pow), + + // Bitwise + BitAnd(BitAnd), + BitOr(BitOr), + BitXor(BitXor), + LShift(LShift), + RShift(RShift), } -#[derive(Debug, Serialize, Deserialize)] -pub struct Call { - lineno: u64, - node_id: u64, - col_offset: u64, - args: Vec, - end_col_offset: u64, - end_lineno: u64, - src: String, - keywords: Vec, - func: Box, - #[serde(rename = "type")] - ttype: Type, +vyper_node!(struct Add {}); +vyper_node!(struct Sub {}); +vyper_node!(struct Mult {}); +vyper_node!(struct Div {}); +vyper_node!(struct FloorDiv {}); +vyper_node!(struct Mod {}); +vyper_node!(struct Pow {}); +vyper_node!(struct BitAnd {}); +vyper_node!(struct BitOr {}); +vyper_node!(struct BitXor {}); +vyper_node!(struct LShift {}); +vyper_node!(struct RShift {}); + +#[derive(Debug, Serialize, Deserialize, Clone)] +#[serde(tag = "ast_type")] +pub enum BooleanOperator { + And(And), + Or(Or), } -#[derive(Debug, Serialize, Deserialize)] -pub struct NotEq { - lineno: u64, - node_id: u64, - col_offset: u64, - end_col_offset: u64, - end_lineno: u64, - src: String, +vyper_node!(struct And {}); +vyper_node!(struct Or {}); + +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +#[serde(tag = "ast_type")] +pub enum ComparisonOperator { + Eq(Eq), + NotEq(NotEq), + Lt(Lt), + LtE(LtE), + Gt(Gt), + GtE(GtE), + In(In), + NotIn(NotIn), } -#[derive(Debug, Serialize, Deserialize)] +vyper_node!(struct Eq {}); +vyper_node!(struct NotEq {}); +vyper_node!(struct Lt {}); +vyper_node!(struct LtE {}); +vyper_node!(struct Gt {}); +vyper_node!(struct GtE {}); +vyper_node!(struct In {}); +vyper_node!(struct NotIn {}); + +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +pub struct Settings {} + +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct VariableAccess { - name: String, - decl_node: DeclNode, - access_path: Vec + pub name: String, + pub decl_node: DeclNode, + pub access_path: Vec, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct DeclNode { - node_id: u64, - source_id: u64 + pub node_id: u64, + pub source_id: u64, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] // #[serde(rename_all = "snake_case", tag = "typeclass")] pub struct Type { pub name: Option, @@ -326,49 +445,19 @@ pub struct Type { pub type_t: Option, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct TypedType { pub name: String, pub type_decl_node: Option, - pub typeclass: Option -} - -#[derive(Debug, Serialize, Deserialize)] -pub struct ModuleType { - name: String, - type_decl_node: TypeDeclNode, -} - -#[derive(Debug, Serialize, Deserialize)] -pub struct StringType { - length: u64, - name: String, -} - -#[derive(Debug, Serialize, Deserialize)] -pub struct BuiltinFunctionType { - name: String, + pub typeclass: Option, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct TypeDeclNode { pub node_id: i64, pub source_id: i64, } -#[derive(Debug, Serialize, Deserialize)] -pub struct IntegerType { - is_signed: bool, - bits: u32, - name: String, -} - -#[derive(Debug, Serialize, Deserialize)] -pub struct EventType { - name: String, - type_decl_node: TypeDeclNode -} - #[cfg(test)] mod tests { use super::*; @@ -376,24 +465,26 @@ mod tests { #[test] fn can_parse_ast() { - fs::read_dir(Path::new(env!("CARGO_MANIFEST_DIR")).join("../../../test-data").join("vyper_ast")) - .unwrap() - .for_each(|path| { - let path = path.unwrap().path(); - let path_str = path.to_string_lossy(); - - let input = fs::read_to_string(&path).unwrap(); - let deserializer = &mut serde_json::Deserializer::from_str(&input); - let result: Result = serde_path_to_error::deserialize(deserializer); - match result { - Err(e) => { - println!("... {path_str} fail: {e}"); - panic!(); - } - Ok(_) => { - println!("... {path_str} ok"); - } + fs::read_dir( + Path::new(env!("CARGO_MANIFEST_DIR")).join("../../../test-data").join("vyper_ast"), + ) + .unwrap() + .for_each(|path| { + let path = path.unwrap().path(); + let path_str = path.to_string_lossy(); + + let input = fs::read_to_string(&path).unwrap(); + let deserializer = &mut serde_json::Deserializer::from_str(&input); + let result: Result = serde_path_to_error::deserialize(deserializer); + match result { + Err(e) => { + println!("... {path_str} fail: {e}"); + panic!(); + } + Ok(_) => { + println!("... {path_str} ok"); } - }) + } + }) } -} \ No newline at end of file +} diff --git a/crates/artifacts/vyper/src/ast/visitor.rs b/crates/artifacts/vyper/src/ast/visitor.rs index e69de29bb..8b1378917 100644 --- a/crates/artifacts/vyper/src/ast/visitor.rs +++ b/crates/artifacts/vyper/src/ast/visitor.rs @@ -0,0 +1 @@ + diff --git a/crates/artifacts/vyper/src/lib.rs b/crates/artifacts/vyper/src/lib.rs index 98185a15e..37c11bd01 100644 --- a/crates/artifacts/vyper/src/lib.rs +++ b/crates/artifacts/vyper/src/lib.rs @@ -13,6 +13,7 @@ mod input; pub use input::VyperInput; mod output; -mod ast; - pub use output::VyperOutput; + +pub mod ast; +pub use ast::*; From 4a3a9d2785a3dab9a46d3eb90cb020cd025a62c0 Mon Sep 17 00:00:00 2001 From: francois Date: Sat, 19 Jul 2025 12:49:59 +0700 Subject: [PATCH 03/11] update node groups --- crates/artifacts/vyper/src/ast/mod.rs | 82 +++++++++++++-------------- test-data/vyper_ast/storage.json | 2 +- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/crates/artifacts/vyper/src/ast/mod.rs b/crates/artifacts/vyper/src/ast/mod.rs index 65834bd3b..588240dc4 100644 --- a/crates/artifacts/vyper/src/ast/mod.rs +++ b/crates/artifacts/vyper/src/ast/mod.rs @@ -342,37 +342,37 @@ vyper_node!( vyper_node!(struct Keyword {}); // TODO -#[derive(Debug, Serialize, Deserialize, Clone)] -#[serde(tag = "ast_type")] -pub enum UnaryOperator { - USub(USub), - Not(Not), - Invert(Invert), -} +node_group!( + UnaryOperator; + + USub, + Not, + Invert, +); vyper_node!(struct USub {}); // TODO vyper_node!(struct Not {}); // TODO vyper_node!(struct Invert {}); // TODO -#[derive(Debug, Serialize, Deserialize, Clone)] -#[serde(tag = "ast_type")] -pub enum BinaryOperator { +node_group!( + BinaryOperator; + // Arithmetic - Add(Add), - Sub(Sub), - Mult(Mult), - Div(Div), - FloorDiv(FloorDiv), - Mod(Mod), - Pow(Pow), + Add, + Sub, + Mult, + Div, + FloorDiv, + Mod, + Pow, // Bitwise - BitAnd(BitAnd), - BitOr(BitOr), - BitXor(BitXor), - LShift(LShift), - RShift(RShift), -} + BitAnd, + BitOr, + BitXor, + LShift, + RShift, +); vyper_node!(struct Add {}); vyper_node!(struct Sub {}); @@ -387,28 +387,28 @@ vyper_node!(struct BitXor {}); vyper_node!(struct LShift {}); vyper_node!(struct RShift {}); -#[derive(Debug, Serialize, Deserialize, Clone)] -#[serde(tag = "ast_type")] -pub enum BooleanOperator { - And(And), - Or(Or), -} +node_group!( + BooleanOperator; + + And, + Or, +); vyper_node!(struct And {}); vyper_node!(struct Or {}); -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] -#[serde(tag = "ast_type")] -pub enum ComparisonOperator { - Eq(Eq), - NotEq(NotEq), - Lt(Lt), - LtE(LtE), - Gt(Gt), - GtE(GtE), - In(In), - NotIn(NotIn), -} +node_group!( + ComparisonOperator; + + Eq, + NotEq, + Lt, + LtE, + Gt, + GtE, + In, + NotIn, +); vyper_node!(struct Eq {}); vyper_node!(struct NotEq {}); diff --git a/test-data/vyper_ast/storage.json b/test-data/vyper_ast/storage.json index a7103a80c..96d7ae357 100644 --- a/test-data/vyper_ast/storage.json +++ b/test-data/vyper_ast/storage.json @@ -1 +1 @@ -{"source_sha256sum": "454ea2181abef802906d413a85e1a6d1219ac3ab4c3cb78200e982382fbfae66", "is_interface": false, "body": [{"end_col_offset": 29, "lineno": 4, "end_lineno": 4, "value": null, "ast_type": "VariableDecl", "is_transient": false, "annotation": {"end_col_offset": 28, "lineno": 4, "end_lineno": 4, "id": "uint256", "ast_type": "Name", "col_offset": 21, "node_id": 7, "src": "54:7:0"}, "is_constant": false, "is_reentrant": false, "node_id": 1, "is_immutable": false, "col_offset": 0, "is_public": true, "src": "33:29:0", "target": {"end_col_offset": 12, "lineno": 4, "end_lineno": 4, "id": "stored_value", "ast_type": "Name", "col_offset": 0, "node_id": 2, "src": "33:12:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, {"end_col_offset": 22, "lineno": 5, "end_lineno": 5, "value": null, "ast_type": "VariableDecl", "is_transient": false, "annotation": {"end_col_offset": 21, "lineno": 5, "end_lineno": 5, "id": "address", "ast_type": "Name", "col_offset": 14, "node_id": 15, "src": "77:7:0"}, "is_constant": false, "is_reentrant": false, "node_id": 9, "is_immutable": false, "col_offset": 0, "is_public": true, "src": "63:22:0", "target": {"end_col_offset": 5, "lineno": 5, "end_lineno": 5, "id": "owner", "ast_type": "Name", "col_offset": 0, "node_id": 10, "src": "63:5:0", "type": {"name": "address"}}, "type": {"name": "address"}}, {"body": [{"end_col_offset": 22, "lineno": 8, "end_lineno": 8, "value": null, "ast_type": "AnnAssign", "annotation": {"end_col_offset": 22, "lineno": 8, "end_lineno": 8, "id": "uint256", "ast_type": "Name", "col_offset": 15, "node_id": 21, "src": "122:7:0"}, "col_offset": 4, "node_id": 18, "src": "111:18:0", "target": {"end_col_offset": 13, "lineno": 8, "end_lineno": 8, "id": "old_value", "ast_type": "Name", "col_offset": 4, "node_id": 19, "src": "111:9:0"}}, {"end_col_offset": 22, "lineno": 9, "end_lineno": 9, "value": null, "ast_type": "AnnAssign", "annotation": {"end_col_offset": 22, "lineno": 9, "end_lineno": 9, "id": "uint256", "ast_type": "Name", "col_offset": 15, "node_id": 26, "src": "145:7:0"}, "col_offset": 4, "node_id": 23, "src": "134:18:0", "target": {"end_col_offset": 13, "lineno": 9, "end_lineno": 9, "id": "new_value", "ast_type": "Name", "col_offset": 4, "node_id": 24, "src": "134:9:0"}}], "end_col_offset": 22, "lineno": 7, "end_lineno": 9, "ast_type": "EventDef", "col_offset": 0, "doc_string": null, "node_id": 17, "name": "ValueChanged", "src": "87:65:0"}, {"body": [{"end_col_offset": 27, "lineno": 13, "end_lineno": 13, "value": {"end_col_offset": 27, "lineno": 13, "end_lineno": 13, "value": {"end_col_offset": 20, "lineno": 13, "end_lineno": 13, "id": "msg", "ast_type": "Name", "col_offset": 17, "node_id": 36, "src": "195:3:0", "type": {"name": "msg"}}, "ast_type": "Attribute", "col_offset": 17, "node_id": 35, "src": "195:10:0", "attr": "sender", "type": {"name": "address"}}, "ast_type": "Assign", "col_offset": 4, "node_id": 30, "src": "182:23:0", "target": {"end_col_offset": 14, "lineno": 13, "end_lineno": 13, "value": {"end_col_offset": 8, "lineno": 13, "end_lineno": 13, "id": "self", "ast_type": "Name", "col_offset": 4, "node_id": 32, "src": "182:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 4, "node_id": 31, "src": "182:10:0", "attr": "owner", "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 9, "source_id": 0}, "access_path": []}], "variable_writes": [{"name": "owner", "decl_node": {"node_id": 9, "source_id": 0}, "access_path": []}]}}, {"end_col_offset": 26, "lineno": 14, "end_lineno": 14, "value": {"end_col_offset": 26, "lineno": 14, "end_lineno": 14, "value": 42, "ast_type": "Int", "col_offset": 24, "node_id": 44, "src": "230:2:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "ast_type": "Assign", "col_offset": 4, "node_id": 39, "src": "210:22:0", "target": {"end_col_offset": 21, "lineno": 14, "end_lineno": 14, "value": {"end_col_offset": 8, "lineno": 14, "end_lineno": 14, "id": "self", "ast_type": "Name", "col_offset": 4, "node_id": 41, "src": "210:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 4, "node_id": 40, "src": "210:17:0", "attr": "stored_value", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "stored_value", "decl_node": {"node_id": 1, "source_id": 0}, "access_path": []}], "variable_writes": [{"name": "stored_value", "decl_node": {"node_id": 1, "source_id": 0}, "access_path": []}]}}], "end_col_offset": 26, "lineno": 12, "returns": null, "end_lineno": 14, "args": {"defaults": [], "end_col_offset": 26, "lineno": 12, "end_lineno": 14, "args": [], "ast_type": "arguments", "col_offset": 0, "node_id": 29, "default": null, "src": "162:70:0"}, "ast_type": "FunctionDef", "col_offset": 0, "doc_string": null, "node_id": 28, "name": "__init__", "pos": null, "decorator_list": [{"end_col_offset": 7, "lineno": 11, "end_lineno": 11, "id": "deploy", "ast_type": "Name", "col_offset": 1, "node_id": 45, "src": "155:6:0"}], "src": "162:70:0"}, {"body": [{"end_col_offset": 61, "msg": {"end_col_offset": 61, "lineno": 18, "end_lineno": 18, "value": "Only owner can set val", "ast_type": "Str", "col_offset": 37, "node_id": 63, "src": "310:24:0", "type": {"length": 22, "name": "String", "typeclass": "string"}}, "lineno": 18, "end_lineno": 18, "ast_type": "Assert", "test": {"end_col_offset": 35, "lineno": 18, "right": {"end_col_offset": 35, "lineno": 18, "end_lineno": 18, "value": {"end_col_offset": 29, "lineno": 18, "end_lineno": 18, "id": "self", "ast_type": "Name", "col_offset": 25, "node_id": 60, "src": "298:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 25, "node_id": 59, "src": "298:10:0", "attr": "owner", "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 9, "source_id": 0}, "access_path": []}]}, "end_lineno": 18, "ast_type": "Compare", "col_offset": 11, "node_id": 53, "src": "284:24:0", "left": {"end_col_offset": 21, "lineno": 18, "end_lineno": 18, "value": {"end_col_offset": 14, "lineno": 18, "end_lineno": 18, "id": "msg", "ast_type": "Name", "col_offset": 11, "node_id": 55, "src": "284:3:0", "type": {"name": "msg"}}, "ast_type": "Attribute", "col_offset": 11, "node_id": 54, "src": "284:10:0", "attr": "sender", "type": {"name": "address"}}, "op": {"end_col_offset": 35, "lineno": 18, "end_lineno": 18, "ast_type": "Eq", "col_offset": 11, "node_id": 124, "src": "284:24:0"}, "type": {"name": "bool"}}, "col_offset": 4, "node_id": 52, "src": "277:57:0"}, {"end_col_offset": 44, "msg": {"end_col_offset": 44, "lineno": 19, "end_lineno": 19, "value": "Value must be positive", "ast_type": "Str", "col_offset": 20, "node_id": 70, "src": "355:24:0", "type": {"length": 22, "name": "String", "typeclass": "string"}}, "lineno": 19, "end_lineno": 19, "ast_type": "Assert", "test": {"end_col_offset": 18, "lineno": 19, "right": {"end_col_offset": 18, "lineno": 19, "end_lineno": 19, "value": 0, "ast_type": "Int", "col_offset": 17, "node_id": 69, "src": "352:1:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "end_lineno": 19, "ast_type": "Compare", "col_offset": 11, "node_id": 65, "src": "346:7:0", "left": {"end_col_offset": 14, "lineno": 19, "end_lineno": 19, "id": "val", "ast_type": "Name", "col_offset": 11, "node_id": 66, "src": "346:3:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "val", "decl_node": {"node_id": 49, "source_id": 0}, "access_path": []}]}, "op": {"end_col_offset": 18, "lineno": 19, "end_lineno": 19, "ast_type": "Gt", "col_offset": 11, "node_id": 68, "src": "346:7:0"}, "type": {"name": "bool"}}, "col_offset": 4, "node_id": 64, "src": "339:40:0"}, {"end_col_offset": 42, "lineno": 21, "end_lineno": 21, "value": {"end_col_offset": 42, "lineno": 21, "end_lineno": 21, "value": {"end_col_offset": 29, "lineno": 21, "end_lineno": 21, "id": "self", "ast_type": "Name", "col_offset": 25, "node_id": 77, "src": "406:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 25, "node_id": 76, "src": "406:17:0", "attr": "stored_value", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "stored_value", "decl_node": {"node_id": 1, "source_id": 0}, "access_path": []}]}, "ast_type": "AnnAssign", "annotation": {"end_col_offset": 22, "lineno": 21, "end_lineno": 21, "id": "uint256", "ast_type": "Name", "col_offset": 15, "node_id": 74, "src": "396:7:0"}, "col_offset": 4, "node_id": 71, "src": "385:38:0", "target": {"end_col_offset": 13, "lineno": 21, "end_lineno": 21, "id": "old_value", "ast_type": "Name", "col_offset": 4, "node_id": 72, "src": "385:9:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "old_value", "decl_node": {"node_id": 71, "source_id": 0}, "access_path": []}]}}, {"end_col_offset": 27, "lineno": 22, "end_lineno": 22, "value": {"end_col_offset": 27, "lineno": 22, "end_lineno": 22, "id": "val", "ast_type": "Name", "col_offset": 24, "node_id": 85, "src": "448:3:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "val", "decl_node": {"node_id": 49, "source_id": 0}, "access_path": []}]}, "ast_type": "Assign", "col_offset": 4, "node_id": 80, "src": "428:23:0", "target": {"end_col_offset": 21, "lineno": 22, "end_lineno": 22, "value": {"end_col_offset": 8, "lineno": 22, "end_lineno": 22, "id": "self", "ast_type": "Name", "col_offset": 4, "node_id": 82, "src": "428:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 4, "node_id": 81, "src": "428:17:0", "attr": "stored_value", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "stored_value", "decl_node": {"node_id": 1, "source_id": 0}, "access_path": []}], "variable_writes": [{"name": "stored_value", "decl_node": {"node_id": 1, "source_id": 0}, "access_path": []}]}}, {"end_col_offset": 56, "lineno": 24, "end_lineno": 24, "value": {"end_col_offset": 56, "lineno": 24, "end_lineno": 24, "args": [], "ast_type": "Call", "col_offset": 8, "func": {"end_col_offset": 20, "lineno": 24, "end_lineno": 24, "id": "ValueChanged", "ast_type": "Name", "col_offset": 8, "node_id": 90, "src": "461:12:0", "type": {"type_t": {"name": "ValueChanged", "type_decl_node": {"node_id": 17, "source_id": 0}, "typeclass": "event"}}}, "node_id": 89, "src": "461:48:0", "keywords": [{"end_col_offset": 40, "lineno": 24, "end_lineno": 24, "value": {"end_col_offset": 40, "lineno": 24, "end_lineno": 24, "id": "old_value", "ast_type": "Name", "col_offset": 31, "node_id": 93, "src": "484:9:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "old_value", "decl_node": {"node_id": 71, "source_id": 0}, "access_path": []}]}, "ast_type": "keyword", "col_offset": 21, "node_id": 92, "arg": "old_value", "src": "474:19:0"}, {"end_col_offset": 55, "lineno": 24, "end_lineno": 24, "value": {"end_col_offset": 55, "lineno": 24, "end_lineno": 24, "id": "val", "ast_type": "Name", "col_offset": 52, "node_id": 96, "src": "505:3:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "val", "decl_node": {"node_id": 49, "source_id": 0}, "access_path": []}]}, "ast_type": "keyword", "col_offset": 42, "node_id": 95, "arg": "new_value", "src": "495:13:0"}], "type": {"name": "(void)"}}, "ast_type": "Log", "col_offset": 4, "node_id": 88, "src": "457:52:0", "type": {"name": "ValueChanged", "type_decl_node": {"node_id": 17, "source_id": 0}, "typeclass": "event"}}], "end_col_offset": 56, "lineno": 17, "returns": null, "end_lineno": 24, "args": {"defaults": [], "end_col_offset": 56, "lineno": 17, "end_lineno": 24, "args": [{"end_col_offset": 26, "lineno": 17, "end_lineno": 17, "ast_type": "arg", "col_offset": 14, "annotation": {"end_col_offset": 26, "lineno": 17, "end_lineno": 17, "id": "uint256", "ast_type": "Name", "col_offset": 19, "node_id": 50, "src": "263:7:0"}, "node_id": 49, "arg": "val", "src": "258:12:0"}], "ast_type": "arguments", "col_offset": 0, "node_id": 48, "default": null, "src": "244:265:0"}, "ast_type": "FunctionDef", "col_offset": 0, "doc_string": null, "node_id": 47, "name": "set_value", "pos": null, "decorator_list": [{"end_col_offset": 9, "lineno": 16, "end_lineno": 16, "id": "external", "ast_type": "Name", "col_offset": 1, "node_id": 98, "src": "235:8:0"}], "src": "244:265:0"}, {"body": [{"end_col_offset": 28, "lineno": 29, "end_lineno": 29, "value": {"end_col_offset": 28, "lineno": 29, "end_lineno": 29, "value": {"end_col_offset": 15, "lineno": 29, "end_lineno": 29, "id": "self", "ast_type": "Name", "col_offset": 11, "node_id": 104, "src": "566:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 11, "node_id": 103, "src": "566:17:0", "attr": "stored_value", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "stored_value", "decl_node": {"node_id": 1, "source_id": 0}, "access_path": []}]}, "ast_type": "Return", "col_offset": 4, "node_id": 102, "src": "559:24:0"}], "end_col_offset": 28, "lineno": 28, "returns": {"end_col_offset": 26, "lineno": 28, "end_lineno": 28, "id": "uint256", "ast_type": "Name", "col_offset": 19, "node_id": 111, "src": "546:7:0"}, "end_lineno": 29, "args": {"defaults": [], "end_col_offset": 28, "lineno": 28, "end_lineno": 29, "args": [], "ast_type": "arguments", "col_offset": 0, "node_id": 101, "default": null, "src": "527:56:0"}, "ast_type": "FunctionDef", "col_offset": 0, "doc_string": null, "node_id": 100, "name": "get_value", "pos": null, "decorator_list": [{"end_col_offset": 9, "lineno": 26, "end_lineno": 26, "id": "external", "ast_type": "Name", "col_offset": 1, "node_id": 107, "src": "512:8:0"}, {"end_col_offset": 5, "lineno": 27, "end_lineno": 27, "id": "view", "ast_type": "Name", "col_offset": 1, "node_id": 109, "src": "522:4:0"}], "src": "527:56:0"}, {"body": [{"end_col_offset": 72, "msg": {"end_col_offset": 72, "lineno": 33, "end_lineno": 33, "value": "Only owner can transfer ownership", "ast_type": "Str", "col_offset": 37, "node_id": 129, "src": "676:35:0", "type": {"length": 33, "name": "String", "typeclass": "string"}}, "lineno": 33, "end_lineno": 33, "ast_type": "Assert", "test": {"end_col_offset": 35, "lineno": 33, "right": {"end_col_offset": 35, "lineno": 33, "end_lineno": 33, "value": {"end_col_offset": 29, "lineno": 33, "end_lineno": 33, "id": "self", "ast_type": "Name", "col_offset": 25, "node_id": 126, "src": "664:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 25, "node_id": 125, "src": "664:10:0", "attr": "owner", "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 9, "source_id": 0}, "access_path": []}]}, "end_lineno": 33, "ast_type": "Compare", "col_offset": 11, "node_id": 119, "src": "650:24:0", "left": {"end_col_offset": 21, "lineno": 33, "end_lineno": 33, "value": {"end_col_offset": 14, "lineno": 33, "end_lineno": 33, "id": "msg", "ast_type": "Name", "col_offset": 11, "node_id": 121, "src": "650:3:0", "type": {"name": "msg"}}, "ast_type": "Attribute", "col_offset": 11, "node_id": 120, "src": "650:10:0", "attr": "sender", "type": {"name": "address"}}, "op": {"end_col_offset": 35, "lineno": 18, "end_lineno": 18, "ast_type": "Eq", "col_offset": 11, "node_id": 124, "src": "284:24:0"}, "type": {"name": "bool"}}, "col_offset": 4, "node_id": 118, "src": "643:68:0"}, {"end_col_offset": 74, "msg": {"end_col_offset": 74, "lineno": 34, "end_lineno": 34, "value": "New owner cannot be zero address", "ast_type": "Str", "col_offset": 40, "node_id": 140, "src": "752:34:0", "type": {"length": 32, "name": "String", "typeclass": "string"}}, "lineno": 34, "end_lineno": 34, "ast_type": "Assert", "test": {"end_col_offset": 38, "lineno": 34, "right": {"end_col_offset": 38, "lineno": 34, "end_lineno": 34, "args": [{"end_col_offset": 37, "lineno": 34, "end_lineno": 34, "id": "address", "ast_type": "Name", "col_offset": 30, "node_id": 138, "src": "742:7:0", "type": {"type_t": {"name": "address"}}}], "ast_type": "Call", "col_offset": 24, "func": {"end_col_offset": 29, "lineno": 34, "end_lineno": 34, "id": "empty", "ast_type": "Name", "col_offset": 24, "node_id": 136, "src": "736:5:0", "type": {"name": "empty", "typeclass": "builtin_function"}}, "node_id": 135, "src": "736:14:0", "keywords": [], "type": {"name": "address"}}, "end_lineno": 34, "ast_type": "Compare", "col_offset": 11, "node_id": 131, "src": "723:27:0", "left": {"end_col_offset": 20, "lineno": 34, "end_lineno": 34, "id": "new_owner", "ast_type": "Name", "col_offset": 11, "node_id": 132, "src": "723:9:0", "type": {"name": "address"}, "variable_reads": [{"name": "new_owner", "decl_node": {"node_id": 115, "source_id": 0}, "access_path": []}]}, "op": {"end_col_offset": 38, "lineno": 34, "end_lineno": 34, "ast_type": "NotEq", "col_offset": 11, "node_id": 134, "src": "723:27:0"}, "type": {"name": "bool"}}, "col_offset": 4, "node_id": 130, "src": "716:70:0"}, {"end_col_offset": 26, "lineno": 36, "end_lineno": 36, "value": {"end_col_offset": 26, "lineno": 36, "end_lineno": 36, "id": "new_owner", "ast_type": "Name", "col_offset": 17, "node_id": 146, "src": "805:9:0", "type": {"name": "address"}, "variable_reads": [{"name": "new_owner", "decl_node": {"node_id": 115, "source_id": 0}, "access_path": []}]}, "ast_type": "Assign", "col_offset": 4, "node_id": 141, "src": "792:22:0", "target": {"end_col_offset": 14, "lineno": 36, "end_lineno": 36, "value": {"end_col_offset": 8, "lineno": 36, "end_lineno": 36, "id": "self", "ast_type": "Name", "col_offset": 4, "node_id": 143, "src": "792:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 4, "node_id": 142, "src": "792:10:0", "attr": "owner", "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 9, "source_id": 0}, "access_path": []}], "variable_writes": [{"name": "owner", "decl_node": {"node_id": 9, "source_id": 0}, "access_path": []}]}}], "end_col_offset": 26, "lineno": 32, "returns": null, "end_lineno": 36, "args": {"defaults": [], "end_col_offset": 26, "lineno": 32, "end_lineno": 36, "args": [{"end_col_offset": 41, "lineno": 32, "end_lineno": 32, "ast_type": "arg", "col_offset": 23, "annotation": {"end_col_offset": 41, "lineno": 32, "end_lineno": 32, "id": "address", "ast_type": "Name", "col_offset": 34, "node_id": 116, "src": "629:7:0"}, "node_id": 115, "arg": "new_owner", "src": "618:18:0"}], "ast_type": "arguments", "col_offset": 0, "node_id": 114, "default": null, "src": "595:219:0"}, "ast_type": "FunctionDef", "col_offset": 0, "doc_string": null, "node_id": 113, "name": "transfer_ownership", "pos": null, "decorator_list": [{"end_col_offset": 9, "lineno": 31, "end_lineno": 31, "id": "external", "ast_type": "Name", "col_offset": 1, "node_id": 148, "src": "586:8:0"}], "src": "595:219:0"}], "end_col_offset": 27, "path": "src/Storage.vy", "resolved_path": "/home/francois/tmp/equivalent/src/Storage.vy", "end_lineno": 36, "lineno": 1, "ast_type": "Module", "col_offset": 0, "doc_string": null, "node_id": 0, "name": null, "settings": {}, "src": "0:815:0", "source_id": 0, "type": {"name": "src/Storage.vy", "type_decl_node": {"node_id": 0, "source_id": 0}, "typeclass": "module"}} \ No newline at end of file +{"source_sha256sum": "454ea2181abef802906d413a85e1a6d1219ac3ab4c3cb78200e982382fbfae66", "is_interface": false, "body": [{"end_col_offset": 29, "lineno": 4, "end_lineno": 4, "value": null, "ast_type": "VariableDecl", "is_transient": false, "annotation": {"end_col_offset": 28, "lineno": 4, "end_lineno": 4, "id": "uint256", "ast_type": "Name", "col_offset": 21, "node_id": 7, "src": "54:7:0"}, "is_constant": false, "is_reentrant": false, "node_id": 1, "is_immutable": false, "col_offset": 0, "is_public": true, "src": "33:29:0", "target": {"end_col_offset": 12, "lineno": 4, "end_lineno": 4, "id": "stored_value", "ast_type": "Name", "col_offset": 0, "node_id": 2, "src": "33:12:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, {"end_col_offset": 22, "lineno": 5, "end_lineno": 5, "value": null, "ast_type": "VariableDecl", "is_transient": false, "annotation": {"end_col_offset": 21, "lineno": 5, "end_lineno": 5, "id": "address", "ast_type": "Name", "col_offset": 14, "node_id": 15, "src": "77:7:0"}, "is_constant": false, "is_reentrant": false, "node_id": 9, "is_immutable": false, "col_offset": 0, "is_public": true, "src": "63:22:0", "target": {"end_col_offset": 5, "lineno": 5, "end_lineno": 5, "id": "owner", "ast_type": "Name", "col_offset": 0, "node_id": 10, "src": "63:5:0", "type": {"name": "address"}}, "type": {"name": "address"}}, {"body": [{"end_col_offset": 22, "lineno": 8, "end_lineno": 8, "value": null, "ast_type": "AnnAssign", "annotation": {"end_col_offset": 22, "lineno": 8, "end_lineno": 8, "id": "uint256", "ast_type": "Name", "col_offset": 15, "node_id": 21, "src": "122:7:0"}, "col_offset": 4, "node_id": 18, "src": "111:18:0", "target": {"end_col_offset": 13, "lineno": 8, "end_lineno": 8, "id": "old_value", "ast_type": "Name", "col_offset": 4, "node_id": 19, "src": "111:9:0"}}, {"end_col_offset": 22, "lineno": 9, "end_lineno": 9, "value": null, "ast_type": "AnnAssign", "annotation": {"end_col_offset": 22, "lineno": 9, "end_lineno": 9, "id": "uint256", "ast_type": "Name", "col_offset": 15, "node_id": 26, "src": "145:7:0"}, "col_offset": 4, "node_id": 23, "src": "134:18:0", "target": {"end_col_offset": 13, "lineno": 9, "end_lineno": 9, "id": "new_value", "ast_type": "Name", "col_offset": 4, "node_id": 24, "src": "134:9:0"}}], "end_col_offset": 22, "lineno": 7, "end_lineno": 9, "ast_type": "EventDef", "col_offset": 0, "doc_string": null, "node_id": 17, "name": "ValueChanged", "src": "87:65:0"}, {"body": [{"end_col_offset": 27, "lineno": 13, "end_lineno": 13, "value": {"end_col_offset": 27, "lineno": 13, "end_lineno": 13, "value": {"end_col_offset": 20, "lineno": 13, "end_lineno": 13, "id": "msg", "ast_type": "Name", "col_offset": 17, "node_id": 36, "src": "195:3:0", "type": {"name": "msg"}}, "ast_type": "Attribute", "col_offset": 17, "node_id": 35, "src": "195:10:0", "attr": "sender", "type": {"name": "address"}}, "ast_type": "Assign", "col_offset": 4, "node_id": 30, "src": "182:23:0", "target": {"end_col_offset": 14, "lineno": 13, "end_lineno": 13, "value": {"end_col_offset": 8, "lineno": 13, "end_lineno": 13, "id": "self", "ast_type": "Name", "col_offset": 4, "node_id": 32, "src": "182:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 4, "node_id": 31, "src": "182:10:0", "attr": "owner", "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 9, "source_id": 0}, "access_path": []}], "variable_writes": [{"name": "owner", "decl_node": {"node_id": 9, "source_id": 0}, "access_path": []}]}}, {"end_col_offset": 26, "lineno": 14, "end_lineno": 14, "value": {"end_col_offset": 26, "lineno": 14, "end_lineno": 14, "value": 42, "ast_type": "Int", "col_offset": 24, "node_id": 44, "src": "230:2:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "ast_type": "Assign", "col_offset": 4, "node_id": 39, "src": "210:22:0", "target": {"end_col_offset": 21, "lineno": 14, "end_lineno": 14, "value": {"end_col_offset": 8, "lineno": 14, "end_lineno": 14, "id": "self", "ast_type": "Name", "col_offset": 4, "node_id": 41, "src": "210:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 4, "node_id": 40, "src": "210:17:0", "attr": "stored_value", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "stored_value", "decl_node": {"node_id": 1, "source_id": 0}, "access_path": []}], "variable_writes": [{"name": "stored_value", "decl_node": {"node_id": 1, "source_id": 0}, "access_path": []}]}}], "end_col_offset": 26, "lineno": 12, "returns": null, "end_lineno": 14, "args": {"defaults": [], "end_col_offset": 26, "lineno": 12, "end_lineno": 14, "args": [], "ast_type": "arguments", "col_offset": 0, "node_id": 29, "default": null, "src": "162:70:0"}, "ast_type": "FunctionDef", "col_offset": 0, "doc_string": null, "node_id": 28, "name": "__init__", "pos": null, "decorator_list": [{"end_col_offset": 7, "lineno": 11, "end_lineno": 11, "id": "deploy", "ast_type": "Name", "col_offset": 1, "node_id": 45, "src": "155:6:0"}], "src": "162:70:0"}, {"body": [{"end_col_offset": 61, "msg": {"end_col_offset": 61, "lineno": 18, "end_lineno": 18, "value": "Only owner can set val", "ast_type": "Str", "col_offset": 37, "node_id": 63, "src": "310:24:0", "type": {"length": 22, "name": "String", "typeclass": "string"}}, "lineno": 18, "end_lineno": 18, "ast_type": "Assert", "test": {"end_col_offset": 35, "lineno": 18, "right": {"end_col_offset": 35, "lineno": 18, "end_lineno": 18, "value": {"end_col_offset": 29, "lineno": 18, "end_lineno": 18, "id": "self", "ast_type": "Name", "col_offset": 25, "node_id": 60, "src": "298:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 25, "node_id": 59, "src": "298:10:0", "attr": "owner", "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 9, "source_id": 0}, "access_path": []}]}, "end_lineno": 18, "ast_type": "Compare", "col_offset": 11, "node_id": 53, "src": "284:24:0", "left": {"end_col_offset": 21, "lineno": 18, "end_lineno": 18, "value": {"end_col_offset": 14, "lineno": 18, "end_lineno": 18, "id": "msg", "ast_type": "Name", "col_offset": 11, "node_id": 55, "src": "284:3:0", "type": {"name": "msg"}}, "ast_type": "Attribute", "col_offset": 11, "node_id": 54, "src": "284:10:0", "attr": "sender", "type": {"name": "address"}}, "op": {"end_col_offset": 35, "lineno": 18, "end_lineno": 18, "ast_type": "Eq", "col_offset": 11, "node_id": 124, "src": "284:24:0"}, "type": {"name": "bool"}}, "col_offset": 4, "node_id": 52, "src": "277:57:0"}, {"end_col_offset": 44, "msg": {"end_col_offset": 44, "lineno": 19, "end_lineno": 19, "value": "Value must be positive", "ast_type": "Str", "col_offset": 20, "node_id": 70, "src": "355:24:0", "type": {"length": 22, "name": "String", "typeclass": "string"}}, "lineno": 19, "end_lineno": 19, "ast_type": "Assert", "test": {"end_col_offset": 18, "lineno": 19, "right": {"end_col_offset": 18, "lineno": 19, "end_lineno": 19, "value": 0, "ast_type": "Int", "col_offset": 17, "node_id": 69, "src": "352:1:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "end_lineno": 19, "ast_type": "Compare", "col_offset": 11, "node_id": 65, "src": "346:7:0", "left": {"end_col_offset": 14, "lineno": 19, "end_lineno": 19, "id": "val", "ast_type": "Name", "col_offset": 11, "node_id": 66, "src": "346:3:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "val", "decl_node": {"node_id": 49, "source_id": 0}, "access_path": []}]}, "op": {"end_col_offset": 18, "lineno": 19, "end_lineno": 19, "ast_type": "Gt", "col_offset": 11, "node_id": 68, "src": "346:7:0"}, "type": {"name": "bool"}}, "col_offset": 4, "node_id": 64, "src": "339:40:0"}, {"end_col_offset": 42, "lineno": 21, "end_lineno": 21, "value": {"end_col_offset": 42, "lineno": 21, "end_lineno": 21, "value": {"end_col_offset": 29, "lineno": 21, "end_lineno": 21, "id": "self", "ast_type": "Name", "col_offset": 25, "node_id": 77, "src": "406:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 25, "node_id": 76, "src": "406:17:0", "attr": "stored_value", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "stored_value", "decl_node": {"node_id": 1, "source_id": 0}, "access_path": []}]}, "ast_type": "AnnAssign", "annotation": {"end_col_offset": 22, "lineno": 21, "end_lineno": 21, "id": "uint256", "ast_type": "Name", "col_offset": 15, "node_id": 74, "src": "396:7:0"}, "col_offset": 4, "node_id": 71, "src": "385:38:0", "target": {"end_col_offset": 13, "lineno": 21, "end_lineno": 21, "id": "old_value", "ast_type": "Name", "col_offset": 4, "node_id": 72, "src": "385:9:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "old_value", "decl_node": {"node_id": 71, "source_id": 0}, "access_path": []}]}}, {"end_col_offset": 27, "lineno": 22, "end_lineno": 22, "value": {"end_col_offset": 27, "lineno": 22, "end_lineno": 22, "id": "val", "ast_type": "Name", "col_offset": 24, "node_id": 85, "src": "448:3:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "val", "decl_node": {"node_id": 49, "source_id": 0}, "access_path": []}]}, "ast_type": "Assign", "col_offset": 4, "node_id": 80, "src": "428:23:0", "target": {"end_col_offset": 21, "lineno": 22, "end_lineno": 22, "value": {"end_col_offset": 8, "lineno": 22, "end_lineno": 22, "id": "self", "ast_type": "Name", "col_offset": 4, "node_id": 82, "src": "428:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 4, "node_id": 81, "src": "428:17:0", "attr": "stored_value", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "stored_value", "decl_node": {"node_id": 1, "source_id": 0}, "access_path": []}], "variable_writes": [{"name": "stored_value", "decl_node": {"node_id": 1, "source_id": 0}, "access_path": []}]}}, {"end_col_offset": 56, "lineno": 24, "end_lineno": 24, "value": {"end_col_offset": 56, "lineno": 24, "end_lineno": 24, "args": [], "ast_type": "Call", "col_offset": 8, "func": {"end_col_offset": 20, "lineno": 24, "end_lineno": 24, "id": "ValueChanged", "ast_type": "Name", "col_offset": 8, "node_id": 90, "src": "461:12:0", "type": {"type_t": {"name": "ValueChanged", "type_decl_node": {"node_id": 17, "source_id": 0}, "typeclass": "event"}}}, "node_id": 89, "src": "461:48:0", "keywords": [{"end_col_offset": 40, "lineno": 24, "end_lineno": 24, "value": {"end_col_offset": 40, "lineno": 24, "end_lineno": 24, "id": "old_value", "ast_type": "Name", "col_offset": 31, "node_id": 93, "src": "484:9:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "old_value", "decl_node": {"node_id": 71, "source_id": 0}, "access_path": []}]}, "ast_type": "keyword", "col_offset": 21, "node_id": 92, "arg": "old_value", "src": "474:19:0"}, {"end_col_offset": 55, "lineno": 24, "end_lineno": 24, "value": {"end_col_offset": 55, "lineno": 24, "end_lineno": 24, "id": "val", "ast_type": "Name", "col_offset": 52, "node_id": 96, "src": "505:3:0", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "val", "decl_node": {"node_id": 49, "source_id": 0}, "access_path": []}]}, "ast_type": "keyword", "col_offset": 42, "node_id": 95, "arg": "new_value", "src": "495:13:0"}], "type": {"name": "(void)"}}, "ast_type": "Log", "col_offset": 4, "node_id": 88, "src": "457:52:0", "type": {"name": "ValueChanged", "type_decl_node": {"node_id": 17, "source_id": 0}, "typeclass": "event"}}], "end_col_offset": 56, "lineno": 17, "returns": null, "end_lineno": 24, "args": {"defaults": [], "end_col_offset": 56, "lineno": 17, "end_lineno": 24, "args": [{"end_col_offset": 26, "lineno": 17, "end_lineno": 17, "ast_type": "arg", "col_offset": 14, "annotation": {"end_col_offset": 26, "lineno": 17, "end_lineno": 17, "id": "uint256", "ast_type": "Name", "col_offset": 19, "node_id": 50, "src": "263:7:0"}, "node_id": 49, "arg": "val", "src": "258:12:0"}], "ast_type": "arguments", "col_offset": 0, "node_id": 48, "default": null, "src": "244:265:0"}, "ast_type": "FunctionDef", "col_offset": 0, "doc_string": null, "node_id": 47, "name": "set_value", "pos": null, "decorator_list": [{"end_col_offset": 9, "lineno": 16, "end_lineno": 16, "id": "external", "ast_type": "Name", "col_offset": 1, "node_id": 98, "src": "235:8:0"}], "src": "244:265:0"}, {"body": [{"end_col_offset": 28, "lineno": 29, "end_lineno": 29, "value": {"end_col_offset": 28, "lineno": 29, "end_lineno": 29, "value": {"end_col_offset": 15, "lineno": 29, "end_lineno": 29, "id": "self", "ast_type": "Name", "col_offset": 11, "node_id": 104, "src": "566:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 11, "node_id": 103, "src": "566:17:0", "attr": "stored_value", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "stored_value", "decl_node": {"node_id": 1, "source_id": 0}, "access_path": []}]}, "ast_type": "Return", "col_offset": 4, "node_id": 102, "src": "559:24:0"}], "end_col_offset": 28, "lineno": 28, "returns": {"end_col_offset": 26, "lineno": 28, "end_lineno": 28, "id": "uint256", "ast_type": "Name", "col_offset": 19, "node_id": 111, "src": "546:7:0"}, "end_lineno": 29, "args": {"defaults": [], "end_col_offset": 28, "lineno": 28, "end_lineno": 29, "args": [], "ast_type": "arguments", "col_offset": 0, "node_id": 101, "default": null, "src": "527:56:0"}, "ast_type": "FunctionDef", "col_offset": 0, "doc_string": null, "node_id": 100, "name": "get_value", "pos": null, "decorator_list": [{"end_col_offset": 9, "lineno": 26, "end_lineno": 26, "id": "external", "ast_type": "Name", "col_offset": 1, "node_id": 107, "src": "512:8:0"}, {"end_col_offset": 5, "lineno": 27, "end_lineno": 27, "id": "view", "ast_type": "Name", "col_offset": 1, "node_id": 109, "src": "522:4:0"}], "src": "527:56:0"}, {"body": [{"end_col_offset": 72, "msg": {"end_col_offset": 72, "lineno": 33, "end_lineno": 33, "value": "Only owner can transfer ownership", "ast_type": "Str", "col_offset": 37, "node_id": 129, "src": "676:35:0", "type": {"length": 33, "name": "String", "typeclass": "string"}}, "lineno": 33, "end_lineno": 33, "ast_type": "Assert", "test": {"end_col_offset": 35, "lineno": 33, "right": {"end_col_offset": 35, "lineno": 33, "end_lineno": 33, "value": {"end_col_offset": 29, "lineno": 33, "end_lineno": 33, "id": "self", "ast_type": "Name", "col_offset": 25, "node_id": 126, "src": "664:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 25, "node_id": 125, "src": "664:10:0", "attr": "owner", "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 9, "source_id": 0}, "access_path": []}]}, "end_lineno": 33, "ast_type": "Compare", "col_offset": 11, "node_id": 119, "src": "650:24:0", "left": {"end_col_offset": 21, "lineno": 33, "end_lineno": 33, "value": {"end_col_offset": 14, "lineno": 33, "end_lineno": 33, "id": "msg", "ast_type": "Name", "col_offset": 11, "node_id": 121, "src": "650:3:0", "type": {"name": "msg"}}, "ast_type": "Attribute", "col_offset": 11, "node_id": 120, "src": "650:10:0", "attr": "sender", "type": {"name": "address"}}, "op": {"end_col_offset": 35, "lineno": 18, "end_lineno": 18, "ast_type": "Eq", "col_offset": 11, "node_id": 124, "src": "284:24:0"}, "type": {"name": "bool"}}, "col_offset": 4, "node_id": 118, "src": "643:68:0"}, {"end_col_offset": 74, "msg": {"end_col_offset": 74, "lineno": 34, "end_lineno": 34, "value": "New owner cannot be zero address", "ast_type": "Str", "col_offset": 40, "node_id": 140, "src": "752:34:0", "type": {"length": 32, "name": "String", "typeclass": "string"}}, "lineno": 34, "end_lineno": 34, "ast_type": "Assert", "test": {"end_col_offset": 38, "lineno": 34, "right": {"end_col_offset": 38, "lineno": 34, "end_lineno": 34, "args": [{"end_col_offset": 37, "lineno": 34, "end_lineno": 34, "id": "address", "ast_type": "Name", "col_offset": 30, "node_id": 138, "src": "742:7:0", "type": {"type_t": {"name": "address"}}}], "ast_type": "Call", "col_offset": 24, "func": {"end_col_offset": 29, "lineno": 34, "end_lineno": 34, "id": "empty", "ast_type": "Name", "col_offset": 24, "node_id": 136, "src": "736:5:0", "type": {"name": "empty", "typeclass": "builtin_function"}}, "node_id": 135, "src": "736:14:0", "keywords": [], "type": {"name": "address"}}, "end_lineno": 34, "ast_type": "Compare", "col_offset": 11, "node_id": 131, "src": "723:27:0", "left": {"end_col_offset": 20, "lineno": 34, "end_lineno": 34, "id": "new_owner", "ast_type": "Name", "col_offset": 11, "node_id": 132, "src": "723:9:0", "type": {"name": "address"}, "variable_reads": [{"name": "new_owner", "decl_node": {"node_id": 115, "source_id": 0}, "access_path": []}]}, "op": {"end_col_offset": 38, "lineno": 34, "end_lineno": 34, "ast_type": "NotEq", "col_offset": 11, "node_id": 134, "src": "723:27:0"}, "type": {"name": "bool"}}, "col_offset": 4, "node_id": 130, "src": "716:70:0"}, {"end_col_offset": 26, "lineno": 36, "end_lineno": 36, "value": {"end_col_offset": 26, "lineno": 36, "end_lineno": 36, "id": "new_owner", "ast_type": "Name", "col_offset": 17, "node_id": 146, "src": "805:9:0", "type": {"name": "address"}, "variable_reads": [{"name": "new_owner", "decl_node": {"node_id": 115, "source_id": 0}, "access_path": []}]}, "ast_type": "Assign", "col_offset": 4, "node_id": 141, "src": "792:22:0", "target": {"end_col_offset": 14, "lineno": 36, "end_lineno": 36, "value": {"end_col_offset": 8, "lineno": 36, "end_lineno": 36, "id": "self", "ast_type": "Name", "col_offset": 4, "node_id": 143, "src": "792:4:0", "type": {"name": "self"}}, "ast_type": "Attribute", "col_offset": 4, "node_id": 142, "src": "792:10:0", "attr": "owner", "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 9, "source_id": 0}, "access_path": []}], "variable_writes": [{"name": "owner", "decl_node": {"node_id": 9, "source_id": 0}, "access_path": []}]}}], "end_col_offset": 26, "lineno": 32, "returns": null, "end_lineno": 36, "args": {"defaults": [], "end_col_offset": 26, "lineno": 32, "end_lineno": 36, "args": [{"end_col_offset": 41, "lineno": 32, "end_lineno": 32, "ast_type": "arg", "col_offset": 23, "annotation": {"end_col_offset": 41, "lineno": 32, "end_lineno": 32, "id": "address", "ast_type": "Name", "col_offset": 34, "node_id": 116, "src": "629:7:0"}, "node_id": 115, "arg": "new_owner", "src": "618:18:0"}], "ast_type": "arguments", "col_offset": 0, "node_id": 114, "default": null, "src": "595:219:0"}, "ast_type": "FunctionDef", "col_offset": 0, "doc_string": null, "node_id": 113, "name": "transfer_ownership", "pos": null, "decorator_list": [{"end_col_offset": 9, "lineno": 31, "end_lineno": 31, "id": "external", "ast_type": "Name", "col_offset": 1, "node_id": 148, "src": "586:8:0"}], "src": "595:219:0"}], "end_col_offset": 27, "path": "src/Storage.vy", "resolved_path": "/home/user/examples/src/Storage.vy", "end_lineno": 36, "lineno": 1, "ast_type": "Module", "col_offset": 0, "doc_string": null, "node_id": 0, "name": null, "settings": {}, "src": "0:815:0", "source_id": 0, "type": {"name": "src/Storage.vy", "type_decl_node": {"node_id": 0, "source_id": 0}, "typeclass": "module"}} \ No newline at end of file From caf43264de5dc89b455ee71ce0efbbf48366f5d1 Mon Sep 17 00:00:00 2001 From: francois Date: Fri, 25 Jul 2025 23:00:18 +0700 Subject: [PATCH 04/11] add test cases and fix types --- crates/artifacts/vyper/Cargo.toml | 1 + crates/artifacts/vyper/src/ast/macros.rs | 12 +- crates/artifacts/vyper/src/ast/mod.rs | 418 ++++++++++++++++++----- test-data/vyper_ast/access_control.json | 1 + test-data/vyper_ast/break.json | 1 + test-data/vyper_ast/calls.json | 1 + test-data/vyper_ast/continue.json | 1 + test-data/vyper_ast/erc20.json | 1 + test-data/vyper_ast/flags.json | 1 + test-data/vyper_ast/for.json | 1 + test-data/vyper_ast/implements.json | 1 + test-data/vyper_ast/import.json | 1 + test-data/vyper_ast/import_from.json | 1 + test-data/vyper_ast/initializes.json | 1 + test-data/vyper_ast/raise.json | 1 + test-data/vyper_ast/struct.json | 1 + test-data/vyper_ast/types.json | 1 + test-data/vyper_ast/uses.json | 1 + 18 files changed, 359 insertions(+), 87 deletions(-) create mode 100644 test-data/vyper_ast/access_control.json create mode 100644 test-data/vyper_ast/break.json create mode 100644 test-data/vyper_ast/calls.json create mode 100644 test-data/vyper_ast/continue.json create mode 100644 test-data/vyper_ast/erc20.json create mode 100644 test-data/vyper_ast/flags.json create mode 100644 test-data/vyper_ast/for.json create mode 100644 test-data/vyper_ast/implements.json create mode 100644 test-data/vyper_ast/import.json create mode 100644 test-data/vyper_ast/import_from.json create mode 100644 test-data/vyper_ast/initializes.json create mode 100644 test-data/vyper_ast/raise.json create mode 100644 test-data/vyper_ast/struct.json create mode 100644 test-data/vyper_ast/types.json create mode 100644 test-data/vyper_ast/uses.json diff --git a/crates/artifacts/vyper/Cargo.toml b/crates/artifacts/vyper/Cargo.toml index bb019f40e..fcf041f11 100644 --- a/crates/artifacts/vyper/Cargo.toml +++ b/crates/artifacts/vyper/Cargo.toml @@ -19,6 +19,7 @@ foundry-compilers-artifacts-solc.workspace = true foundry-compilers-core.workspace = true serde.workspace = true +serde_json.workspace = true alloy-primitives.workspace = true alloy-json-abi.workspace = true semver.workspace = true diff --git a/crates/artifacts/vyper/src/ast/macros.rs b/crates/artifacts/vyper/src/ast/macros.rs index 0be041767..ef8cefee9 100644 --- a/crates/artifacts/vyper/src/ast/macros.rs +++ b/crates/artifacts/vyper/src/ast/macros.rs @@ -11,12 +11,12 @@ macro_rules! vyper_node { $(#[$struct_meta])* #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct $name { - pub node_id: u64, + pub node_id: i32, pub src: String, - pub lineno: u64, - pub col_offset: u64, - pub end_lineno: u64, - pub end_col_offset: u64, + pub lineno: u32, + pub col_offset: u32, + pub end_lineno: u32, + pub end_col_offset: u32, $( $(#[$field_meta])* pub $field: $ty @@ -45,5 +45,5 @@ macro_rules! node_group { }; } -pub(crate) use vyper_node; pub(crate) use node_group; +pub(crate) use vyper_node; diff --git a/crates/artifacts/vyper/src/ast/mod.rs b/crates/artifacts/vyper/src/ast/mod.rs index 588240dc4..ecb320b56 100644 --- a/crates/artifacts/vyper/src/ast/mod.rs +++ b/crates/artifacts/vyper/src/ast/mod.rs @@ -1,10 +1,10 @@ use serde::{Deserialize, Serialize}; -pub mod visitor; mod macros; +pub mod visitor; -use macros::{vyper_node}; use crate::ast::macros::node_group; +use macros::vyper_node; vyper_node!( struct Module { @@ -13,7 +13,7 @@ vyper_node!( name: Option, path: String, resolved_path: String, - source_id: u64, + source_id: i32, is_interface: bool, doc_string: Option, settings: Settings, @@ -57,7 +57,7 @@ vyper_node!( args: Arguments, body: Vec, pos: Option, - doc_string: Option, + doc_string: Option, decorator_list: Vec, name: String, returns: Option>, @@ -67,45 +67,97 @@ vyper_node!( vyper_node!( struct VariableDecl { annotation: Box, - value: Option, + value: Option>, + target: Box, is_transient: bool, is_constant: bool, is_reentrant: bool, is_public: bool, - target: Box, is_immutable: bool, #[serde(rename = "type")] - ttype: Type, + ttype: Option, } ); -vyper_node!(struct StructDef {}); +vyper_node!( + struct StructDef { + name: String, + doc_string: Option, + body: Vec, + } +); vyper_node!( struct EventDef { name: String, + doc_string: Option, body: Vec, - doc_string: Option, } ); -vyper_node!(struct FlagDef {}); +vyper_node!( + struct FlagDef { + name: String, + doc_string: Option, + body: Vec, + } +); -vyper_node!(struct InterfaceDef {}); +vyper_node!( + struct InterfaceDef { + name: String, + doc_string: Option, + body: Vec, + } +); -vyper_node!(struct Import {}); +vyper_node!( + struct Import { + alias: Option, + name: String, + import_info: ImportInfo + } +); -vyper_node!(struct ImportFrom {}); +vyper_node!( + struct ImportFrom { + alias: Option, + name: String, + import_info: ImportInfo, + module: Option, + level: u32, + } +); -vyper_node!(struct ImplementsDecl {}); +vyper_node!( + struct ImplementsDecl { + annotation: Box, + } +); -vyper_node!(struct UsesDecl {}); +vyper_node!( + struct UsesDecl { + annotation: Box, + } +); -vyper_node!(struct InitializesDecl {}); +vyper_node!( + struct InitializesDecl { + annotation: Box, + } +); -vyper_node!(struct ExportsDecl {}); +vyper_node!( + struct ExportsDecl { + annotation: Box, + } +); -vyper_node!(struct DocStr {}); +vyper_node!( + struct DocStr { + value: String, + } +); node_group!( Statement; @@ -150,7 +202,9 @@ vyper_node!( } ); -vyper_node!(struct AugAssign {}); +vyper_node!( + struct AugAssign {} +); vyper_node!( struct Return { @@ -158,17 +212,39 @@ vyper_node!( } ); -vyper_node!(struct If {}); +vyper_node!( + struct If { + body: Vec, + test: Box, + orelse: Vec, + } +); -vyper_node!(struct For {}); +vyper_node!( + struct For { + iter: Box, + target: Box, + body: Vec, + } +); -vyper_node!(struct Break {}); +vyper_node!( + struct Break {} +); -vyper_node!(struct Continue {}); +vyper_node!( + struct Continue {} +); -vyper_node!(struct Pass {}); +vyper_node!( + struct Pass {} +); -vyper_node!(struct Raise {}); +vyper_node!( + struct Raise { + exc: Option>, + } +); vyper_node!( struct Assert { @@ -179,14 +255,24 @@ vyper_node!( vyper_node!( struct Log { + value: Call, #[serde(rename = "type")] - ttype: Type, + ttype: Option, } ); -vyper_node!(struct Expr {}); +vyper_node!( + struct Expr { + value: Box, + } +); -vyper_node!(struct NamedExpr {}); +vyper_node!( + struct NamedExpr { + target: Box, + value: Box, + } +); node_group!( Expression; @@ -235,41 +321,91 @@ node_group!( Keyword, ); -vyper_node!(struct Constant {}); // TODO +vyper_node!( + struct Constant { + value: serde_json::Value, + #[serde(rename = "type")] + ttype: Option, + } +); vyper_node!( struct Int { value: u64, #[serde(rename = "type")] - ttype: Type, + ttype: Option, } ); -vyper_node!(struct Decimal {}); // TODO +vyper_node!( + struct Decimal { + value: String, + #[serde(rename = "type")] + ttype: Option, + } +); -vyper_node!(struct Hex {}); // TODO +vyper_node!( + struct Hex { + value: String, + #[serde(rename = "type")] + ttype: Option, + } +); vyper_node!( struct Str { value: String, #[serde(rename = "type")] - ttype: Type, + ttype: Option, } ); -vyper_node!(struct Bytes {}); // TODO +vyper_node!( + struct Bytes { + value: String, + #[serde(rename = "type")] + ttype: Option, + } +); -vyper_node!(struct HexBytes {}); // TODO +vyper_node!( + struct HexBytes { + value: String, + #[serde(rename = "type")] + ttype: Option, + } +); -vyper_node!(struct NameConstant {}); // TODO +vyper_node!( + struct NameConstant { + value: serde_json::Value, + #[serde(rename = "type")] + ttype: Option, + } +); -vyper_node!(struct Ellipsis {}); // TODO +vyper_node!( + struct Ellipsis {} +); // TODO -vyper_node!(struct List {}); // TODO +vyper_node!( + struct List { + elements: Vec, + #[serde(rename = "type")] + ttype: Option, + } +); -vyper_node!(struct Tuple {}); // TODO +vyper_node!( + struct Tuple { + elements: Vec, + } +); -vyper_node!(struct Dict {}); // TODO +vyper_node!( + struct Dict {} +); // TODO vyper_node!( struct Name { @@ -285,19 +421,49 @@ vyper_node!( value: Box, attr: String, #[serde(rename = "type")] - ttype: Type, + ttype: Option, variable_reads: Option>, variable_writes: Option>, } ); -vyper_node!(struct Subscript {}); // TODO +vyper_node!( + struct Subscript { + slice: Box, + value: Box, + #[serde(rename = "type")] + ttype: Option, + variable_reads: Option>, + variable_writes: Option>, + } +); -vyper_node!(struct UnaryOp {}); // TODO +vyper_node!( + struct UnaryOp { + operand: Box, + #[serde(rename = "type")] + ttype: Option, + } +); -vyper_node!(struct BinOp {}); // TODO +vyper_node!( + struct BinOp { + left: Box, + right: Box, + op: Box, + #[serde(rename = "type")] + ttype: Option, + } +); -vyper_node!(struct BoolOp {}); // TODO +vyper_node!( + struct BoolOp { + values: Vec, + op: Box, + #[serde(rename = "type")] + ttype: Option, + } +); vyper_node!( struct Compare { @@ -305,7 +471,7 @@ vyper_node!( right: Box, op: Box, #[serde(rename = "type")] - ttype: Type, + ttype: Option, } ); @@ -315,15 +481,35 @@ vyper_node!( keywords: Vec, func: Box, #[serde(rename = "type")] - ttype: Type, + ttype: Option, } ); -vyper_node!(struct ExtCall {}); // TODO +vyper_node!( + struct ExtCall { + value: Box, + #[serde(rename = "type")] + ttype: Option, + } +); -vyper_node!(struct StaticCall {}); // TODO +vyper_node!( + struct StaticCall { + value: Box, + #[serde(rename = "type")] + ttype: Option, + } +); -vyper_node!(struct IfExp {}); // TODO +vyper_node!( + struct IfExp { + test: Box, + body: Box, + orelse: Box, + #[serde(rename = "type")] + ttype: Option, + } +); vyper_node!( struct Arg { @@ -340,7 +526,12 @@ vyper_node!( } ); -vyper_node!(struct Keyword {}); // TODO +vyper_node!( + struct Keyword { + arg: String, + value: Box, + } +); node_group!( UnaryOperator; @@ -350,9 +541,17 @@ node_group!( Invert, ); -vyper_node!(struct USub {}); // TODO -vyper_node!(struct Not {}); // TODO -vyper_node!(struct Invert {}); // TODO +vyper_node!( + struct USub {} +); + +vyper_node!( + struct Not {} +); + +vyper_node!( + struct Invert {} +); node_group!( BinaryOperator; @@ -374,18 +573,42 @@ node_group!( RShift, ); -vyper_node!(struct Add {}); -vyper_node!(struct Sub {}); -vyper_node!(struct Mult {}); -vyper_node!(struct Div {}); -vyper_node!(struct FloorDiv {}); -vyper_node!(struct Mod {}); -vyper_node!(struct Pow {}); -vyper_node!(struct BitAnd {}); -vyper_node!(struct BitOr {}); -vyper_node!(struct BitXor {}); -vyper_node!(struct LShift {}); -vyper_node!(struct RShift {}); +vyper_node!( + struct Add {} +); +vyper_node!( + struct Sub {} +); +vyper_node!( + struct Mult {} +); +vyper_node!( + struct Div {} +); +vyper_node!( + struct FloorDiv {} +); +vyper_node!( + struct Mod {} +); +vyper_node!( + struct Pow {} +); +vyper_node!( + struct BitAnd {} +); +vyper_node!( + struct BitOr {} +); +vyper_node!( + struct BitXor {} +); +vyper_node!( + struct LShift {} +); +vyper_node!( + struct RShift {} +); node_group!( BooleanOperator; @@ -394,8 +617,12 @@ node_group!( Or, ); -vyper_node!(struct And {}); -vyper_node!(struct Or {}); +vyper_node!( + struct And {} +); +vyper_node!( + struct Or {} +); node_group!( ComparisonOperator; @@ -410,14 +637,30 @@ node_group!( NotIn, ); -vyper_node!(struct Eq {}); -vyper_node!(struct NotEq {}); -vyper_node!(struct Lt {}); -vyper_node!(struct LtE {}); -vyper_node!(struct Gt {}); -vyper_node!(struct GtE {}); -vyper_node!(struct In {}); -vyper_node!(struct NotIn {}); +vyper_node!( + struct Eq {} +); +vyper_node!( + struct NotEq {} +); +vyper_node!( + struct Lt {} +); +vyper_node!( + struct LtE {} +); +vyper_node!( + struct Gt {} +); +vyper_node!( + struct GtE {} +); +vyper_node!( + struct In {} +); +vyper_node!( + struct NotIn {} +); #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct Settings {} @@ -431,16 +674,19 @@ pub struct VariableAccess { #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct DeclNode { - pub node_id: u64, - pub source_id: u64, + pub node_id: i32, + pub source_id: i32, } +// TODO these types could probably be converted to an enum because some fields are exclusive. #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] -// #[serde(rename_all = "snake_case", tag = "typeclass")] pub struct Type { pub name: Option, + pub value_type: Option>, + pub m: Option, pub typeclass: Option, pub is_signed: Option, + pub length: Option, pub bits: Option, pub type_t: Option, } @@ -454,8 +700,18 @@ pub struct TypedType { #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct TypeDeclNode { - pub node_id: i64, - pub source_id: i64, + pub node_id: i32, + pub source_id: i32, +} + +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +pub struct ImportInfo { + alias: Option, + qualified_module_name: String, + source_id: i32, + path: String, + resolved_path: String, + file_sha256sum: String, } #[cfg(test)] diff --git a/test-data/vyper_ast/access_control.json b/test-data/vyper_ast/access_control.json new file mode 100644 index 000000000..9b52df547 --- /dev/null +++ b/test-data/vyper_ast/access_control.json @@ -0,0 +1 @@ +{"source_sha256sum": "0599bba35a7dccced61b9ff455182d2e4591252c4c4dd041ea6493c70cea5112", "node_id": 0, "resolved_path": "/home/user/tmp/snekmate/src/snekmate/auth/access_control.vy", "lineno": 1, "col_offset": 0, "source_id": 0, "body": [{"node_id": 3, "lineno": 68, "alias": null, "level": 0, "col_offset": 0, "ast_type": "ImportFrom", "end_col_offset": 33, "module": "ethereum.ercs", "src": "2641:33:0", "end_lineno": 68, "name": "IERC165", "import_info": {"alias": "IERC165", "qualified_module_name": "ethereum.ercs.IERC165", "source_id": -2, "path": "vyper/builtins/interfaces/IERC165.vyi", "resolved_path": "/home/user/.local/share/uv/tools/vyper/lib/python3.12/site-packages/vyper/builtins/interfaces/IERC165.vyi", "file_sha256sum": "acad3686e02fedd704331956fe4281433d2f7e4bba758270c308ea02d19ce3b8"}}, {"node_id": 5, "lineno": 69, "col_offset": 0, "ast_type": "ImplementsDecl", "end_col_offset": 19, "src": "2675:19:0", "end_lineno": 69, "annotation": {"node_id": 8, "id": "IERC165", "lineno": 69, "col_offset": 12, "ast_type": "Name", "end_col_offset": 19, "src": "2687:7:0", "end_lineno": 69}}, {"node_id": 10, "lineno": 75, "alias": null, "level": 1, "col_offset": 0, "ast_type": "ImportFrom", "end_col_offset": 38, "module": "interfaces", "src": "2810:38:0", "end_lineno": 75, "name": "IAccessControl", "import_info": {"alias": "IAccessControl", "qualified_module_name": "interfaces.IAccessControl", "source_id": 1, "path": "interfaces/IAccessControl.vyi", "resolved_path": "/home/user/tmp/snekmate/src/snekmate/auth/interfaces/IAccessControl.vyi", "file_sha256sum": "30812d9176225074557fcf3b4b70381485054f776bd1351918d240be5059ac2b"}}, {"node_id": 12, "lineno": 76, "col_offset": 0, "ast_type": "ImplementsDecl", "end_col_offset": 26, "src": "2849:26:0", "end_lineno": 76, "annotation": {"node_id": 15, "id": "IAccessControl", "lineno": 76, "col_offset": 12, "ast_type": "Name", "end_col_offset": 26, "src": "2861:14:0", "end_lineno": 76}}, {"node_id": 17, "lineno": 83, "col_offset": 0, "is_immutable": false, "ast_type": "VariableDecl", "is_public": true, "is_reentrant": false, "is_transient": false, "end_col_offset": 62, "is_constant": true, "value": {"args": [{"node_id": 31, "id": "bytes32", "lineno": 83, "col_offset": 54, "ast_type": "Name", "end_col_offset": 61, "src": "3102:7:0", "end_lineno": 83, "type": {"type_t": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}}}], "node_id": 28, "lineno": 83, "func": {"node_id": 29, "id": "empty", "lineno": 83, "col_offset": 48, "ast_type": "Name", "end_col_offset": 53, "src": "3096:5:0", "end_lineno": 83, "type": {"name": "empty", "typeclass": "builtin_function"}}, "col_offset": 48, "ast_type": "Call", "end_col_offset": 62, "keywords": [], "src": "3096:14:0", "end_lineno": 83, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}}, "end_lineno": 83, "src": "3048:62:0", "target": {"node_id": 18, "id": "DEFAULT_ADMIN_ROLE", "lineno": 83, "col_offset": 0, "ast_type": "Name", "end_col_offset": 18, "src": "3048:18:0", "end_lineno": 83, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}}, "annotation": {"node_id": 26, "id": "bytes32", "lineno": 83, "col_offset": 36, "ast_type": "Name", "end_col_offset": 43, "src": "3084:7:0", "end_lineno": 83}, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}}, {"node_id": 33, "lineno": 90, "col_offset": 0, "is_immutable": false, "ast_type": "VariableDecl", "is_public": false, "is_reentrant": false, "is_transient": false, "end_col_offset": 1, "is_constant": true, "value": {"node_id": 44, "lineno": 90, "col_offset": 45, "ast_type": "List", "end_col_offset": 1, "src": "3339:120:0", "end_lineno": 93, "elements": [{"node_id": 45, "lineno": 91, "col_offset": 4, "ast_type": "Hex", "end_col_offset": 14, "value": "0x01FFC9A7", "src": "3345:10:0", "end_lineno": 91, "type": {"m": 4, "name": "bytes4", "typeclass": "bytes_m"}}, {"node_id": 46, "lineno": 92, "col_offset": 4, "ast_type": "Hex", "end_col_offset": 14, "value": "0x7965DB0B", "src": "3399:10:0", "end_lineno": 92, "type": {"m": 4, "name": "bytes4", "typeclass": "bytes_m"}}], "type": {"value_type": {"m": 4, "name": "bytes4", "typeclass": "bytes_m"}, "length": 2, "name": "$SArray", "typeclass": "static_array"}}, "end_lineno": 93, "src": "3294:165:0", "target": {"node_id": 34, "id": "_SUPPORTED_INTERFACES", "lineno": 90, "col_offset": 0, "ast_type": "Name", "end_col_offset": 21, "src": "3294:21:0", "end_lineno": 90}, "annotation": {"node_id": 39, "lineno": 90, "col_offset": 32, "slice": {"node_id": 42, "lineno": 90, "col_offset": 39, "ast_type": "Int", "end_col_offset": 40, "value": 2, "src": "3333:1:0", "end_lineno": 90}, "ast_type": "Subscript", "end_col_offset": 41, "value": {"node_id": 40, "id": "bytes4", "lineno": 90, "col_offset": 32, "ast_type": "Name", "end_col_offset": 38, "src": "3326:6:0", "end_lineno": 90}, "src": "3326:9:0", "end_lineno": 90}, "type": {"value_type": {"m": 4, "name": "bytes4", "typeclass": "bytes_m"}, "length": 2, "name": "$SArray", "typeclass": "static_array"}}, {"node_id": 48, "lineno": 97, "col_offset": 0, "is_immutable": false, "ast_type": "VariableDecl", "is_public": true, "is_reentrant": false, "is_transient": false, "end_col_offset": 57, "is_constant": false, "value": null, "end_lineno": 97, "src": "3522:57:0", "target": {"node_id": 49, "id": "hasRole", "lineno": 97, "col_offset": 0, "ast_type": "Name", "end_col_offset": 7, "src": "3522:7:0", "end_lineno": 97, "type": {"key_type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "value_type": {"key_type": {"name": "address"}, "value_type": {"name": "bool"}, "name": "HashMap", "typeclass": "hashmap"}, "name": "HashMap", "typeclass": "hashmap"}}, "annotation": {"node_id": 54, "lineno": 97, "col_offset": 16, "slice": {"node_id": 57, "lineno": 97, "col_offset": 24, "ast_type": "Tuple", "end_col_offset": 55, "src": "3546:31:0", "end_lineno": 97, "elements": [{"node_id": 58, "id": "bytes32", "lineno": 97, "col_offset": 24, "ast_type": "Name", "end_col_offset": 31, "src": "3546:7:0", "end_lineno": 97}, {"node_id": 60, "lineno": 97, "col_offset": 33, "slice": {"node_id": 63, "lineno": 97, "col_offset": 41, "ast_type": "Tuple", "end_col_offset": 54, "src": "3563:13:0", "end_lineno": 97, "elements": [{"node_id": 64, "id": "address", "lineno": 97, "col_offset": 41, "ast_type": "Name", "end_col_offset": 48, "src": "3563:7:0", "end_lineno": 97}, {"node_id": 66, "id": "bool", "lineno": 97, "col_offset": 50, "ast_type": "Name", "end_col_offset": 54, "src": "3572:4:0", "end_lineno": 97}]}, "ast_type": "Subscript", "end_col_offset": 55, "value": {"node_id": 61, "id": "HashMap", "lineno": 97, "col_offset": 33, "ast_type": "Name", "end_col_offset": 40, "src": "3555:7:0", "end_lineno": 97}, "src": "3555:22:0", "end_lineno": 97}]}, "ast_type": "Subscript", "end_col_offset": 56, "value": {"node_id": 55, "id": "HashMap", "lineno": 97, "col_offset": 16, "ast_type": "Name", "end_col_offset": 23, "src": "3538:7:0", "end_lineno": 97}, "src": "3538:40:0", "end_lineno": 97}, "type": {"key_type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "value_type": {"key_type": {"name": "address"}, "value_type": {"name": "bool"}, "name": "HashMap", "typeclass": "hashmap"}, "name": "HashMap", "typeclass": "hashmap"}}, {"node_id": 72, "lineno": 101, "col_offset": 0, "is_immutable": false, "ast_type": "VariableDecl", "is_public": true, "is_reentrant": false, "is_transient": false, "end_col_offset": 47, "is_constant": false, "value": null, "end_lineno": 101, "src": "3634:47:0", "target": {"node_id": 73, "id": "getRoleAdmin", "lineno": 101, "col_offset": 0, "ast_type": "Name", "end_col_offset": 12, "src": "3634:12:0", "end_lineno": 101, "type": {"key_type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "value_type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "name": "HashMap", "typeclass": "hashmap"}}, "annotation": {"node_id": 78, "lineno": 101, "col_offset": 21, "slice": {"node_id": 81, "lineno": 101, "col_offset": 29, "ast_type": "Tuple", "end_col_offset": 45, "src": "3663:16:0", "end_lineno": 101, "elements": [{"node_id": 82, "id": "bytes32", "lineno": 101, "col_offset": 29, "ast_type": "Name", "end_col_offset": 36, "src": "3663:7:0", "end_lineno": 101}, {"node_id": 84, "id": "bytes32", "lineno": 101, "col_offset": 38, "ast_type": "Name", "end_col_offset": 45, "src": "3672:7:0", "end_lineno": 101}]}, "ast_type": "Subscript", "end_col_offset": 46, "value": {"node_id": 79, "id": "HashMap", "lineno": 101, "col_offset": 21, "ast_type": "Name", "end_col_offset": 28, "src": "3655:7:0", "end_lineno": 101}, "src": "3655:25:0", "end_lineno": 101}, "type": {"key_type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "value_type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "name": "HashMap", "typeclass": "hashmap"}}, {"args": {"args": [], "node_id": 89, "default": null, "lineno": 106, "col_offset": 0, "defaults": [], "ast_type": "arguments", "end_col_offset": 52, "src": "3701:329:0", "end_lineno": 114}, "pos": null, "node_id": 88, "lineno": 106, "col_offset": 0, "body": [{"node_id": 92, "lineno": 114, "col_offset": 4, "ast_type": "Expr", "end_col_offset": 52, "value": {"args": [{"node_id": 98, "id": "DEFAULT_ADMIN_ROLE", "lineno": 114, "col_offset": 21, "ast_type": "Name", "end_col_offset": 39, "src": "3999:18:0", "end_lineno": 114, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "DEFAULT_ADMIN_ROLE", "decl_node": {"node_id": 17, "source_id": 0}, "access_path": []}]}, {"node_id": 100, "lineno": 114, "attr": "sender", "col_offset": 41, "ast_type": "Attribute", "end_col_offset": 51, "value": {"node_id": 101, "id": "msg", "lineno": 114, "col_offset": 41, "ast_type": "Name", "end_col_offset": 44, "src": "4019:3:0", "end_lineno": 114, "type": {"name": "msg"}}, "src": "4019:10:0", "end_lineno": 114, "type": {"name": "address"}}], "node_id": 93, "lineno": 114, "func": {"node_id": 94, "lineno": 114, "attr": "_grant_role", "col_offset": 4, "ast_type": "Attribute", "end_col_offset": 20, "value": {"node_id": 95, "id": "self", "lineno": 114, "col_offset": 4, "ast_type": "Name", "end_col_offset": 8, "src": "3982:4:0", "end_lineno": 114, "type": {"name": "self"}}, "src": "3982:16:0", "end_lineno": 114, "type": {"name": "_grant_role", "type_decl_node": {"node_id": 368, "source_id": 0}, "typeclass": "contract_function"}, "variable_reads": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": []}, {"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access"]}, {"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}], "variable_writes": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}]}, "col_offset": 4, "ast_type": "Call", "end_col_offset": 52, "keywords": [], "src": "3982:48:0", "end_lineno": 114, "type": {"name": "(void)"}}, "src": "3982:48:0", "end_lineno": 114}], "ast_type": "FunctionDef", "end_col_offset": 52, "src": "3701:329:0", "decorator_list": [{"node_id": 104, "id": "deploy", "lineno": 104, "col_offset": 1, "ast_type": "Name", "end_col_offset": 7, "src": "3685:6:0", "end_lineno": 104}, {"node_id": 106, "id": "payable", "lineno": 105, "col_offset": 1, "ast_type": "Name", "end_col_offset": 8, "src": "3693:7:0", "end_lineno": 105}], "doc_string": {"node_id": 108, "lineno": 107, "col_offset": 4, "ast_type": "DocStr", "end_col_offset": 7, "value": "\n @dev To omit the opcodes for checking the `msg.value`\n in the creation-time EVM bytecode, the constructor\n is declared as `payable`.\n @notice The `DEFAULT_ADMIN_ROLE` role will be assigned\n to the `msg.sender`.\n ", "src": "3721:256:0", "end_lineno": 113}, "returns": null, "end_lineno": 114, "name": "__init__"}, {"args": {"args": [{"node_id": 111, "lineno": 119, "arg": "interface_id", "col_offset": 22, "ast_type": "arg", "end_col_offset": 42, "src": "4071:20:0", "end_lineno": 119, "annotation": {"node_id": 112, "id": "bytes4", "lineno": 119, "col_offset": 36, "ast_type": "Name", "end_col_offset": 42, "src": "4085:6:0", "end_lineno": 119}}], "node_id": 110, "default": null, "lineno": 119, "col_offset": 0, "defaults": [], "ast_type": "arguments", "end_col_offset": 48, "src": "4049:376:0", "end_lineno": 127}, "pos": null, "node_id": 109, "lineno": 119, "col_offset": 0, "body": [{"node_id": 116, "lineno": 127, "col_offset": 4, "ast_type": "Return", "end_col_offset": 48, "value": {"node_id": 117, "lineno": 127, "op": {"node_id": 120, "lineno": 127, "col_offset": 11, "ast_type": "In", "end_col_offset": 48, "src": "4388:37:0", "end_lineno": 127}, "col_offset": 11, "left": {"node_id": 118, "id": "interface_id", "lineno": 127, "col_offset": 11, "ast_type": "Name", "end_col_offset": 23, "src": "4388:12:0", "end_lineno": 127, "type": {"m": 4, "name": "bytes4", "typeclass": "bytes_m"}, "variable_reads": [{"name": "interface_id", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": []}]}, "ast_type": "Compare", "end_col_offset": 48, "src": "4388:37:0", "end_lineno": 127, "right": {"node_id": 121, "id": "_SUPPORTED_INTERFACES", "lineno": 127, "col_offset": 27, "ast_type": "Name", "end_col_offset": 48, "src": "4404:21:0", "end_lineno": 127, "type": {"value_type": {"m": 4, "name": "bytes4", "typeclass": "bytes_m"}, "length": 2, "name": "$SArray", "typeclass": "static_array"}, "variable_reads": [{"name": "_SUPPORTED_INTERFACES", "decl_node": {"node_id": 33, "source_id": 0}, "access_path": []}]}, "type": {"name": "bool"}}, "src": "4381:44:0", "end_lineno": 127}], "ast_type": "FunctionDef", "end_col_offset": 48, "src": "4049:376:0", "decorator_list": [{"node_id": 123, "id": "external", "lineno": 117, "col_offset": 1, "ast_type": "Name", "end_col_offset": 9, "src": "4034:8:0", "end_lineno": 117}, {"node_id": 125, "id": "view", "lineno": 118, "col_offset": 1, "ast_type": "Name", "end_col_offset": 5, "src": "4044:4:0", "end_lineno": 118}], "doc_string": {"node_id": 129, "lineno": 120, "col_offset": 4, "ast_type": "DocStr", "end_col_offset": 7, "value": "\n @dev Returns `True` if this contract implements the\n interface defined by `interface_id`.\n @param interface_id The 4-byte interface identifier.\n @return bool The verification whether the contract\n implements the interface or not.\n ", "src": "4106:270:0", "end_lineno": 126}, "returns": {"node_id": 127, "id": "bool", "lineno": 119, "col_offset": 47, "ast_type": "Name", "end_col_offset": 51, "src": "4096:4:0", "end_lineno": 119}, "end_lineno": 127, "name": "supportsInterface"}, {"args": {"args": [{"node_id": 132, "lineno": 131, "arg": "role", "col_offset": 14, "ast_type": "arg", "end_col_offset": 27, "src": "4452:13:0", "end_lineno": 131, "annotation": {"node_id": 133, "id": "bytes32", "lineno": 131, "col_offset": 20, "ast_type": "Name", "end_col_offset": 27, "src": "4458:7:0", "end_lineno": 131}}, {"node_id": 135, "lineno": 131, "arg": "account", "col_offset": 29, "ast_type": "arg", "end_col_offset": 45, "src": "4467:16:0", "end_lineno": 131, "annotation": {"node_id": 136, "id": "address", "lineno": 131, "col_offset": 38, "ast_type": "Name", "end_col_offset": 45, "src": "4476:7:0", "end_lineno": 131}}], "node_id": 131, "default": null, "lineno": 131, "col_offset": 0, "defaults": [], "ast_type": "arguments", "end_col_offset": 35, "src": "4438:473:0", "end_lineno": 142}, "pos": null, "node_id": 130, "lineno": 131, "col_offset": 0, "body": [{"node_id": 140, "lineno": 141, "col_offset": 4, "ast_type": "Expr", "end_col_offset": 57, "value": {"args": [{"node_id": 146, "lineno": 141, "col_offset": 21, "slice": {"node_id": 151, "id": "role", "lineno": 141, "col_offset": 39, "ast_type": "Name", "end_col_offset": 43, "src": "4857:4:0", "end_lineno": 141, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "role", "decl_node": {"node_id": 132, "source_id": 0}, "access_path": []}]}, "ast_type": "Subscript", "end_col_offset": 44, "value": {"node_id": 147, "lineno": 141, "attr": "getRoleAdmin", "col_offset": 21, "ast_type": "Attribute", "end_col_offset": 38, "value": {"node_id": 148, "id": "self", "lineno": 141, "col_offset": 21, "ast_type": "Name", "end_col_offset": 25, "src": "4839:4:0", "end_lineno": 141, "type": {"name": "self"}}, "src": "4839:17:0", "end_lineno": 141, "type": {"key_type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "value_type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "getRoleAdmin", "decl_node": {"node_id": 72, "source_id": 0}, "access_path": []}]}, "src": "4839:23:0", "end_lineno": 141, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "getRoleAdmin", "decl_node": {"node_id": 72, "source_id": 0}, "access_path": ["$subscript_access"]}]}, {"node_id": 154, "lineno": 141, "attr": "sender", "col_offset": 46, "ast_type": "Attribute", "end_col_offset": 56, "value": {"node_id": 155, "id": "msg", "lineno": 141, "col_offset": 46, "ast_type": "Name", "end_col_offset": 49, "src": "4864:3:0", "end_lineno": 141, "type": {"name": "msg"}}, "src": "4864:10:0", "end_lineno": 141, "type": {"name": "address"}}], "node_id": 141, "lineno": 141, "func": {"node_id": 142, "lineno": 141, "attr": "_check_role", "col_offset": 4, "ast_type": "Attribute", "end_col_offset": 20, "value": {"node_id": 143, "id": "self", "lineno": 141, "col_offset": 4, "ast_type": "Name", "end_col_offset": 8, "src": "4822:4:0", "end_lineno": 141, "type": {"name": "self"}}, "src": "4822:16:0", "end_lineno": 141, "type": {"name": "_check_role", "type_decl_node": {"node_id": 286, "source_id": 0}, "typeclass": "contract_function"}, "variable_reads": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": []}, {"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access"]}, {"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}]}, "col_offset": 4, "ast_type": "Call", "end_col_offset": 57, "keywords": [], "src": "4822:53:0", "end_lineno": 141, "type": {"name": "(void)"}}, "src": "4822:53:0", "end_lineno": 141}, {"node_id": 158, "lineno": 142, "col_offset": 4, "ast_type": "Expr", "end_col_offset": 35, "value": {"args": [{"node_id": 164, "id": "role", "lineno": 142, "col_offset": 21, "ast_type": "Name", "end_col_offset": 25, "src": "4897:4:0", "end_lineno": 142, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "role", "decl_node": {"node_id": 132, "source_id": 0}, "access_path": []}]}, {"node_id": 166, "id": "account", "lineno": 142, "col_offset": 27, "ast_type": "Name", "end_col_offset": 34, "src": "4903:7:0", "end_lineno": 142, "type": {"name": "address"}, "variable_reads": [{"name": "account", "decl_node": {"node_id": 135, "source_id": 0}, "access_path": []}]}], "node_id": 159, "lineno": 142, "func": {"node_id": 160, "lineno": 142, "attr": "_grant_role", "col_offset": 4, "ast_type": "Attribute", "end_col_offset": 20, "value": {"node_id": 161, "id": "self", "lineno": 142, "col_offset": 4, "ast_type": "Name", "end_col_offset": 8, "src": "4880:4:0", "end_lineno": 142, "type": {"name": "self"}}, "src": "4880:16:0", "end_lineno": 142, "type": {"name": "_grant_role", "type_decl_node": {"node_id": 368, "source_id": 0}, "typeclass": "contract_function"}, "variable_reads": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": []}, {"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access"]}, {"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}], "variable_writes": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}]}, "col_offset": 4, "ast_type": "Call", "end_col_offset": 35, "keywords": [], "src": "4880:31:0", "end_lineno": 142, "type": {"name": "(void)"}}, "src": "4880:31:0", "end_lineno": 142}], "ast_type": "FunctionDef", "end_col_offset": 35, "src": "4438:473:0", "decorator_list": [{"node_id": 168, "id": "external", "lineno": 130, "col_offset": 1, "ast_type": "Name", "end_col_offset": 9, "src": "4429:8:0", "end_lineno": 130}], "doc_string": {"node_id": 170, "lineno": 132, "col_offset": 4, "ast_type": "DocStr", "end_col_offset": 7, "value": "\n @dev Grants `role` to `account`.\n @notice If `account` had not been already\n granted `role`, emits a `RoleGranted`\n event. Note that the caller must have\n `role`'s admin role.\n @param role The 32-byte role definition.\n @param account The 20-byte address of the account.\n ", "src": "4490:327:0", "end_lineno": 140}, "returns": null, "end_lineno": 142, "name": "grantRole"}, {"args": {"args": [{"node_id": 173, "lineno": 146, "arg": "role", "col_offset": 15, "ast_type": "arg", "end_col_offset": 28, "src": "4939:13:0", "end_lineno": 146, "annotation": {"node_id": 174, "id": "bytes32", "lineno": 146, "col_offset": 21, "ast_type": "Name", "end_col_offset": 28, "src": "4945:7:0", "end_lineno": 146}}, {"node_id": 176, "lineno": 146, "arg": "account", "col_offset": 30, "ast_type": "arg", "end_col_offset": 46, "src": "4954:16:0", "end_lineno": 146, "annotation": {"node_id": 177, "id": "address", "lineno": 146, "col_offset": 39, "ast_type": "Name", "end_col_offset": 46, "src": "4963:7:0", "end_lineno": 146}}], "node_id": 172, "default": null, "lineno": 146, "col_offset": 0, "defaults": [], "ast_type": "arguments", "end_col_offset": 36, "src": "4924:454:0", "end_lineno": 156}, "pos": null, "node_id": 171, "lineno": 146, "col_offset": 0, "body": [{"node_id": 181, "lineno": 155, "col_offset": 4, "ast_type": "Expr", "end_col_offset": 57, "value": {"args": [{"node_id": 187, "lineno": 155, "col_offset": 21, "slice": {"node_id": 192, "id": "role", "lineno": 155, "col_offset": 39, "ast_type": "Name", "end_col_offset": 43, "src": "5323:4:0", "end_lineno": 155, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "role", "decl_node": {"node_id": 173, "source_id": 0}, "access_path": []}]}, "ast_type": "Subscript", "end_col_offset": 44, "value": {"node_id": 188, "lineno": 155, "attr": "getRoleAdmin", "col_offset": 21, "ast_type": "Attribute", "end_col_offset": 38, "value": {"node_id": 189, "id": "self", "lineno": 155, "col_offset": 21, "ast_type": "Name", "end_col_offset": 25, "src": "5305:4:0", "end_lineno": 155, "type": {"name": "self"}}, "src": "5305:17:0", "end_lineno": 155, "type": {"key_type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "value_type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "getRoleAdmin", "decl_node": {"node_id": 72, "source_id": 0}, "access_path": []}]}, "src": "5305:23:0", "end_lineno": 155, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "getRoleAdmin", "decl_node": {"node_id": 72, "source_id": 0}, "access_path": ["$subscript_access"]}]}, {"node_id": 195, "lineno": 155, "attr": "sender", "col_offset": 46, "ast_type": "Attribute", "end_col_offset": 56, "value": {"node_id": 196, "id": "msg", "lineno": 155, "col_offset": 46, "ast_type": "Name", "end_col_offset": 49, "src": "5330:3:0", "end_lineno": 155, "type": {"name": "msg"}}, "src": "5330:10:0", "end_lineno": 155, "type": {"name": "address"}}], "node_id": 182, "lineno": 155, "func": {"node_id": 183, "lineno": 155, "attr": "_check_role", "col_offset": 4, "ast_type": "Attribute", "end_col_offset": 20, "value": {"node_id": 184, "id": "self", "lineno": 155, "col_offset": 4, "ast_type": "Name", "end_col_offset": 8, "src": "5288:4:0", "end_lineno": 155, "type": {"name": "self"}}, "src": "5288:16:0", "end_lineno": 155, "type": {"name": "_check_role", "type_decl_node": {"node_id": 286, "source_id": 0}, "typeclass": "contract_function"}, "variable_reads": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": []}, {"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access"]}, {"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}]}, "col_offset": 4, "ast_type": "Call", "end_col_offset": 57, "keywords": [], "src": "5288:53:0", "end_lineno": 155, "type": {"name": "(void)"}}, "src": "5288:53:0", "end_lineno": 155}, {"node_id": 199, "lineno": 156, "col_offset": 4, "ast_type": "Expr", "end_col_offset": 36, "value": {"args": [{"node_id": 205, "id": "role", "lineno": 156, "col_offset": 22, "ast_type": "Name", "end_col_offset": 26, "src": "5364:4:0", "end_lineno": 156, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "role", "decl_node": {"node_id": 173, "source_id": 0}, "access_path": []}]}, {"node_id": 207, "id": "account", "lineno": 156, "col_offset": 28, "ast_type": "Name", "end_col_offset": 35, "src": "5370:7:0", "end_lineno": 156, "type": {"name": "address"}, "variable_reads": [{"name": "account", "decl_node": {"node_id": 176, "source_id": 0}, "access_path": []}]}], "node_id": 200, "lineno": 156, "func": {"node_id": 201, "lineno": 156, "attr": "_revoke_role", "col_offset": 4, "ast_type": "Attribute", "end_col_offset": 21, "value": {"node_id": 202, "id": "self", "lineno": 156, "col_offset": 4, "ast_type": "Name", "end_col_offset": 8, "src": "5346:4:0", "end_lineno": 156, "type": {"name": "self"}}, "src": "5346:17:0", "end_lineno": 156, "type": {"name": "_revoke_role", "type_decl_node": {"node_id": 428, "source_id": 0}, "typeclass": "contract_function"}, "variable_reads": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": []}, {"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access"]}, {"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}], "variable_writes": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}]}, "col_offset": 4, "ast_type": "Call", "end_col_offset": 36, "keywords": [], "src": "5346:32:0", "end_lineno": 156, "type": {"name": "(void)"}}, "src": "5346:32:0", "end_lineno": 156}], "ast_type": "FunctionDef", "end_col_offset": 36, "src": "4924:454:0", "decorator_list": [{"node_id": 209, "id": "external", "lineno": 145, "col_offset": 1, "ast_type": "Name", "end_col_offset": 9, "src": "4915:8:0", "end_lineno": 145}], "doc_string": {"node_id": 211, "lineno": 147, "col_offset": 4, "ast_type": "DocStr", "end_col_offset": 7, "value": "\n @dev Revokes `role` from `account`.\n @notice If `account` had been granted `role`,\n emits a `RoleRevoked` event. Note that\n the caller must have `role`'s admin role.\n @param role The 32-byte role definition.\n @param account The 20-byte address of the account.\n ", "src": "4977:306:0", "end_lineno": 154}, "returns": null, "end_lineno": 156, "name": "revokeRole"}, {"args": {"args": [{"node_id": 214, "lineno": 160, "arg": "role", "col_offset": 17, "ast_type": "arg", "end_col_offset": 30, "src": "5408:13:0", "end_lineno": 160, "annotation": {"node_id": 215, "id": "bytes32", "lineno": 160, "col_offset": 23, "ast_type": "Name", "end_col_offset": 30, "src": "5414:7:0", "end_lineno": 160}}, {"node_id": 217, "lineno": 160, "arg": "account", "col_offset": 32, "ast_type": "arg", "end_col_offset": 48, "src": "5423:16:0", "end_lineno": 160, "annotation": {"node_id": 218, "id": "address", "lineno": 160, "col_offset": 41, "ast_type": "Name", "end_col_offset": 48, "src": "5432:7:0", "end_lineno": 160}}], "node_id": 213, "default": null, "lineno": 160, "col_offset": 0, "defaults": [], "ast_type": "arguments", "end_col_offset": 36, "src": "5391:769:0", "end_lineno": 175}, "pos": null, "node_id": 212, "lineno": 160, "col_offset": 0, "body": [{"node_id": 222, "lineno": 174, "col_offset": 4, "test": {"node_id": 223, "lineno": 174, "op": {"node_id": 226, "lineno": 174, "col_offset": 11, "ast_type": "Eq", "end_col_offset": 32, "src": "6048:21:0", "end_lineno": 174}, "col_offset": 11, "left": {"node_id": 224, "id": "account", "lineno": 174, "col_offset": 11, "ast_type": "Name", "end_col_offset": 18, "src": "6048:7:0", "end_lineno": 174, "type": {"name": "address"}, "variable_reads": [{"name": "account", "decl_node": {"node_id": 217, "source_id": 0}, "access_path": []}]}, "ast_type": "Compare", "end_col_offset": 32, "src": "6048:21:0", "end_lineno": 174, "right": {"node_id": 227, "lineno": 174, "attr": "sender", "col_offset": 22, "ast_type": "Attribute", "end_col_offset": 32, "value": {"node_id": 228, "id": "msg", "lineno": 174, "col_offset": 22, "ast_type": "Name", "end_col_offset": 25, "src": "6059:3:0", "end_lineno": 174, "type": {"name": "msg"}}, "src": "6059:10:0", "end_lineno": 174, "type": {"name": "address"}}, "type": {"name": "bool"}}, "ast_type": "Assert", "msg": {"node_id": 231, "lineno": 174, "col_offset": 34, "ast_type": "Str", "end_col_offset": 86, "value": "access_control: can only renounce roles for itself", "src": "6071:52:0", "end_lineno": 174, "type": {"length": 50, "name": "String", "typeclass": "string"}}, "end_col_offset": 86, "src": "6041:82:0", "end_lineno": 174}, {"node_id": 232, "lineno": 175, "col_offset": 4, "ast_type": "Expr", "end_col_offset": 36, "value": {"args": [{"node_id": 238, "id": "role", "lineno": 175, "col_offset": 22, "ast_type": "Name", "end_col_offset": 26, "src": "6146:4:0", "end_lineno": 175, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "role", "decl_node": {"node_id": 214, "source_id": 0}, "access_path": []}]}, {"node_id": 240, "id": "account", "lineno": 175, "col_offset": 28, "ast_type": "Name", "end_col_offset": 35, "src": "6152:7:0", "end_lineno": 175, "type": {"name": "address"}, "variable_reads": [{"name": "account", "decl_node": {"node_id": 217, "source_id": 0}, "access_path": []}]}], "node_id": 233, "lineno": 175, "func": {"node_id": 234, "lineno": 175, "attr": "_revoke_role", "col_offset": 4, "ast_type": "Attribute", "end_col_offset": 21, "value": {"node_id": 235, "id": "self", "lineno": 175, "col_offset": 4, "ast_type": "Name", "end_col_offset": 8, "src": "6128:4:0", "end_lineno": 175, "type": {"name": "self"}}, "src": "6128:17:0", "end_lineno": 175, "type": {"name": "_revoke_role", "type_decl_node": {"node_id": 428, "source_id": 0}, "typeclass": "contract_function"}, "variable_reads": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": []}, {"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access"]}, {"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}], "variable_writes": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}]}, "col_offset": 4, "ast_type": "Call", "end_col_offset": 36, "keywords": [], "src": "6128:32:0", "end_lineno": 175, "type": {"name": "(void)"}}, "src": "6128:32:0", "end_lineno": 175}], "ast_type": "FunctionDef", "end_col_offset": 36, "src": "5391:769:0", "decorator_list": [{"node_id": 242, "id": "external", "lineno": 159, "col_offset": 1, "ast_type": "Name", "end_col_offset": 9, "src": "5382:8:0", "end_lineno": 159}], "doc_string": {"node_id": 244, "lineno": 161, "col_offset": 4, "ast_type": "DocStr", "end_col_offset": 7, "value": "\n @dev Revokes `role` from the calling account.\n @notice Roles are often managed via `grantRole`\n and `revokeRole`. This function's purpose\n is to provide a mechanism for accounts to\n lose their privileges if they are compromised\n (such as when a trusted device is misplaced).\n If the calling account had been granted `role`,\n emits a `RoleRevoked` event. Note that the\n caller must be `account`.\n @param role The 32-byte role definition.\n @param account The 20-byte address of the account.\n ", "src": "5446:590:0", "end_lineno": 173}, "returns": null, "end_lineno": 175, "name": "renounceRole"}, {"args": {"args": [{"node_id": 247, "lineno": 179, "arg": "role", "col_offset": 19, "ast_type": "arg", "end_col_offset": 32, "src": "6192:13:0", "end_lineno": 179, "annotation": {"node_id": 248, "id": "bytes32", "lineno": 179, "col_offset": 25, "ast_type": "Name", "end_col_offset": 32, "src": "6198:7:0", "end_lineno": 179}}, {"node_id": 250, "lineno": 179, "arg": "admin_role", "col_offset": 34, "ast_type": "arg", "end_col_offset": 53, "src": "6207:19:0", "end_lineno": 179, "annotation": {"node_id": 251, "id": "bytes32", "lineno": 179, "col_offset": 46, "ast_type": "Name", "end_col_offset": 53, "src": "6219:7:0", "end_lineno": 179}}], "node_id": 246, "default": null, "lineno": 179, "col_offset": 0, "defaults": [], "ast_type": "arguments", "end_col_offset": 42, "src": "6173:405:0", "end_lineno": 188}, "pos": null, "node_id": 245, "lineno": 179, "col_offset": 0, "body": [{"node_id": 255, "lineno": 187, "col_offset": 4, "ast_type": "Expr", "end_col_offset": 57, "value": {"args": [{"node_id": 261, "lineno": 187, "col_offset": 21, "slice": {"node_id": 266, "id": "role", "lineno": 187, "col_offset": 39, "ast_type": "Name", "end_col_offset": 43, "src": "6517:4:0", "end_lineno": 187, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "role", "decl_node": {"node_id": 247, "source_id": 0}, "access_path": []}]}, "ast_type": "Subscript", "end_col_offset": 44, "value": {"node_id": 262, "lineno": 187, "attr": "getRoleAdmin", "col_offset": 21, "ast_type": "Attribute", "end_col_offset": 38, "value": {"node_id": 263, "id": "self", "lineno": 187, "col_offset": 21, "ast_type": "Name", "end_col_offset": 25, "src": "6499:4:0", "end_lineno": 187, "type": {"name": "self"}}, "src": "6499:17:0", "end_lineno": 187, "type": {"key_type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "value_type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "getRoleAdmin", "decl_node": {"node_id": 72, "source_id": 0}, "access_path": []}]}, "src": "6499:23:0", "end_lineno": 187, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "getRoleAdmin", "decl_node": {"node_id": 72, "source_id": 0}, "access_path": ["$subscript_access"]}]}, {"node_id": 269, "lineno": 187, "attr": "sender", "col_offset": 46, "ast_type": "Attribute", "end_col_offset": 56, "value": {"node_id": 270, "id": "msg", "lineno": 187, "col_offset": 46, "ast_type": "Name", "end_col_offset": 49, "src": "6524:3:0", "end_lineno": 187, "type": {"name": "msg"}}, "src": "6524:10:0", "end_lineno": 187, "type": {"name": "address"}}], "node_id": 256, "lineno": 187, "func": {"node_id": 257, "lineno": 187, "attr": "_check_role", "col_offset": 4, "ast_type": "Attribute", "end_col_offset": 20, "value": {"node_id": 258, "id": "self", "lineno": 187, "col_offset": 4, "ast_type": "Name", "end_col_offset": 8, "src": "6482:4:0", "end_lineno": 187, "type": {"name": "self"}}, "src": "6482:16:0", "end_lineno": 187, "type": {"name": "_check_role", "type_decl_node": {"node_id": 286, "source_id": 0}, "typeclass": "contract_function"}, "variable_reads": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": []}, {"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access"]}, {"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}]}, "col_offset": 4, "ast_type": "Call", "end_col_offset": 57, "keywords": [], "src": "6482:53:0", "end_lineno": 187, "type": {"name": "(void)"}}, "src": "6482:53:0", "end_lineno": 187}, {"node_id": 273, "lineno": 188, "col_offset": 4, "ast_type": "Expr", "end_col_offset": 42, "value": {"args": [{"node_id": 279, "id": "role", "lineno": 188, "col_offset": 25, "ast_type": "Name", "end_col_offset": 29, "src": "6561:4:0", "end_lineno": 188, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "role", "decl_node": {"node_id": 247, "source_id": 0}, "access_path": []}]}, {"node_id": 281, "id": "admin_role", "lineno": 188, "col_offset": 31, "ast_type": "Name", "end_col_offset": 41, "src": "6567:10:0", "end_lineno": 188, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "admin_role", "decl_node": {"node_id": 250, "source_id": 0}, "access_path": []}]}], "node_id": 274, "lineno": 188, "func": {"node_id": 275, "lineno": 188, "attr": "_set_role_admin", "col_offset": 4, "ast_type": "Attribute", "end_col_offset": 24, "value": {"node_id": 276, "id": "self", "lineno": 188, "col_offset": 4, "ast_type": "Name", "end_col_offset": 8, "src": "6540:4:0", "end_lineno": 188, "type": {"name": "self"}}, "src": "6540:20:0", "end_lineno": 188, "type": {"name": "_set_role_admin", "type_decl_node": {"node_id": 315, "source_id": 0}, "typeclass": "contract_function"}, "variable_reads": [{"name": "getRoleAdmin", "decl_node": {"node_id": 72, "source_id": 0}, "access_path": []}, {"name": "getRoleAdmin", "decl_node": {"node_id": 72, "source_id": 0}, "access_path": ["$subscript_access"]}], "variable_writes": [{"name": "getRoleAdmin", "decl_node": {"node_id": 72, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "col_offset": 4, "ast_type": "Call", "end_col_offset": 42, "keywords": [], "src": "6540:38:0", "end_lineno": 188, "type": {"name": "(void)"}}, "src": "6540:38:0", "end_lineno": 188}], "ast_type": "FunctionDef", "end_col_offset": 42, "src": "6173:405:0", "decorator_list": [{"node_id": 283, "id": "external", "lineno": 178, "col_offset": 1, "ast_type": "Name", "end_col_offset": 9, "src": "6164:8:0", "end_lineno": 178}], "doc_string": {"node_id": 285, "lineno": 180, "col_offset": 4, "ast_type": "DocStr", "end_col_offset": 7, "value": "\n @dev Sets `admin_role` as `role`'s admin role.\n @notice Note that the caller must have `role`'s\n admin role.\n @param role The 32-byte role definition.\n @param admin_role The new 32-byte admin role definition.\n ", "src": "6233:244:0", "end_lineno": 186}, "returns": null, "end_lineno": 188, "name": "set_role_admin"}, {"args": {"args": [{"node_id": 288, "lineno": 193, "arg": "role", "col_offset": 16, "ast_type": "arg", "end_col_offset": 29, "src": "6613:13:0", "end_lineno": 193, "annotation": {"node_id": 289, "id": "bytes32", "lineno": 193, "col_offset": 22, "ast_type": "Name", "end_col_offset": 29, "src": "6619:7:0", "end_lineno": 193}}, {"node_id": 291, "lineno": 193, "arg": "account", "col_offset": 31, "ast_type": "arg", "end_col_offset": 47, "src": "6628:16:0", "end_lineno": 193, "annotation": {"node_id": 292, "id": "address", "lineno": 193, "col_offset": 40, "ast_type": "Name", "end_col_offset": 47, "src": "6637:7:0", "end_lineno": 193}}], "node_id": 287, "default": null, "lineno": 193, "col_offset": 0, "defaults": [], "ast_type": "arguments", "end_col_offset": 81, "src": "6597:329:0", "end_lineno": 200}, "pos": null, "node_id": 286, "lineno": 193, "col_offset": 0, "body": [{"node_id": 296, "lineno": 200, "col_offset": 4, "test": {"node_id": 297, "lineno": 200, "col_offset": 11, "slice": {"node_id": 306, "id": "account", "lineno": 200, "col_offset": 30, "ast_type": "Name", "end_col_offset": 37, "src": "6875:7:0", "end_lineno": 200, "type": {"name": "address"}, "variable_reads": [{"name": "account", "decl_node": {"node_id": 291, "source_id": 0}, "access_path": []}]}, "ast_type": "Subscript", "end_col_offset": 38, "value": {"node_id": 298, "lineno": 200, "col_offset": 11, "slice": {"node_id": 303, "id": "role", "lineno": 200, "col_offset": 24, "ast_type": "Name", "end_col_offset": 28, "src": "6869:4:0", "end_lineno": 200, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "role", "decl_node": {"node_id": 288, "source_id": 0}, "access_path": []}]}, "ast_type": "Subscript", "end_col_offset": 29, "value": {"node_id": 299, "lineno": 200, "attr": "hasRole", "col_offset": 11, "ast_type": "Attribute", "end_col_offset": 23, "value": {"node_id": 300, "id": "self", "lineno": 200, "col_offset": 11, "ast_type": "Name", "end_col_offset": 15, "src": "6856:4:0", "end_lineno": 200, "type": {"name": "self"}}, "src": "6856:12:0", "end_lineno": 200, "type": {"key_type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "value_type": {"key_type": {"name": "address"}, "value_type": {"name": "bool"}, "name": "HashMap", "typeclass": "hashmap"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": []}]}, "src": "6856:18:0", "end_lineno": 200, "type": {"key_type": {"name": "address"}, "value_type": {"name": "bool"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "src": "6856:27:0", "end_lineno": 200, "type": {"name": "bool"}, "variable_reads": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}]}, "ast_type": "Assert", "msg": {"node_id": 309, "lineno": 200, "col_offset": 40, "ast_type": "Str", "end_col_offset": 81, "value": "access_control: account is missing role", "src": "6885:41:0", "end_lineno": 200, "type": {"length": 39, "name": "String", "typeclass": "string"}}, "end_col_offset": 81, "src": "6849:77:0", "end_lineno": 200}], "ast_type": "FunctionDef", "end_col_offset": 81, "src": "6597:329:0", "decorator_list": [{"node_id": 310, "id": "internal", "lineno": 191, "col_offset": 1, "ast_type": "Name", "end_col_offset": 9, "src": "6582:8:0", "end_lineno": 191}, {"node_id": 312, "id": "view", "lineno": 192, "col_offset": 1, "ast_type": "Name", "end_col_offset": 5, "src": "6592:4:0", "end_lineno": 192}], "doc_string": {"node_id": 314, "lineno": 194, "col_offset": 4, "ast_type": "DocStr", "end_col_offset": 7, "value": "\n @dev Reverts with a standard message if `account`\n is missing `role`.\n @param role The 32-byte role definition.\n @param account The 20-byte address of the account.\n ", "src": "6651:193:0", "end_lineno": 199}, "returns": null, "end_lineno": 200, "name": "_check_role"}, {"args": {"args": [{"node_id": 317, "lineno": 204, "arg": "role", "col_offset": 20, "ast_type": "arg", "end_col_offset": 33, "src": "6959:13:0", "end_lineno": 204, "annotation": {"node_id": 318, "id": "bytes32", "lineno": 204, "col_offset": 26, "ast_type": "Name", "end_col_offset": 33, "src": "6965:7:0", "end_lineno": 204}}, {"node_id": 320, "lineno": 204, "arg": "admin_role", "col_offset": 35, "ast_type": "arg", "end_col_offset": 54, "src": "6974:19:0", "end_lineno": 204, "annotation": {"node_id": 321, "id": "bytes32", "lineno": 204, "col_offset": 47, "ast_type": "Name", "end_col_offset": 54, "src": "6986:7:0", "end_lineno": 204}}], "node_id": 316, "default": null, "lineno": 204, "col_offset": 0, "defaults": [], "ast_type": "arguments", "end_col_offset": 114, "src": "6939:527:0", "end_lineno": 214}, "pos": null, "node_id": 315, "lineno": 204, "col_offset": 0, "body": [{"node_id": 325, "lineno": 212, "col_offset": 4, "ast_type": "AnnAssign", "end_col_offset": 58, "value": {"node_id": 330, "lineno": 212, "col_offset": 35, "slice": {"node_id": 335, "id": "role", "lineno": 212, "col_offset": 53, "ast_type": "Name", "end_col_offset": 57, "src": "7305:4:0", "end_lineno": 212, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "role", "decl_node": {"node_id": 317, "source_id": 0}, "access_path": []}]}, "ast_type": "Subscript", "end_col_offset": 58, "value": {"node_id": 331, "lineno": 212, "attr": "getRoleAdmin", "col_offset": 35, "ast_type": "Attribute", "end_col_offset": 52, "value": {"node_id": 332, "id": "self", "lineno": 212, "col_offset": 35, "ast_type": "Name", "end_col_offset": 39, "src": "7287:4:0", "end_lineno": 212, "type": {"name": "self"}}, "src": "7287:17:0", "end_lineno": 212, "type": {"key_type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "value_type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "getRoleAdmin", "decl_node": {"node_id": 72, "source_id": 0}, "access_path": []}]}, "src": "7287:23:0", "end_lineno": 212, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "getRoleAdmin", "decl_node": {"node_id": 72, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "src": "7256:54:0", "end_lineno": 212, "target": {"node_id": 326, "id": "previous_admin_role", "lineno": 212, "col_offset": 4, "ast_type": "Name", "end_col_offset": 23, "src": "7256:19:0", "end_lineno": 212, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "previous_admin_role", "decl_node": {"node_id": 325, "source_id": 0}, "access_path": []}]}, "annotation": {"node_id": 328, "id": "bytes32", "lineno": 212, "col_offset": 25, "ast_type": "Name", "end_col_offset": 32, "src": "7277:7:0", "end_lineno": 212}}, {"node_id": 338, "lineno": 213, "col_offset": 4, "ast_type": "Assign", "end_col_offset": 40, "value": {"node_id": 347, "id": "admin_role", "lineno": 213, "col_offset": 30, "ast_type": "Name", "end_col_offset": 40, "src": "7341:10:0", "end_lineno": 213, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "admin_role", "decl_node": {"node_id": 320, "source_id": 0}, "access_path": []}]}, "src": "7315:36:0", "end_lineno": 213, "target": {"node_id": 339, "lineno": 213, "col_offset": 4, "slice": {"node_id": 344, "id": "role", "lineno": 213, "col_offset": 22, "ast_type": "Name", "end_col_offset": 26, "src": "7333:4:0", "end_lineno": 213, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "role", "decl_node": {"node_id": 317, "source_id": 0}, "access_path": []}]}, "ast_type": "Subscript", "end_col_offset": 27, "value": {"node_id": 340, "lineno": 213, "attr": "getRoleAdmin", "col_offset": 4, "ast_type": "Attribute", "end_col_offset": 21, "value": {"node_id": 341, "id": "self", "lineno": 213, "col_offset": 4, "ast_type": "Name", "end_col_offset": 8, "src": "7315:4:0", "end_lineno": 213, "type": {"name": "self"}}, "src": "7315:17:0", "end_lineno": 213, "type": {"key_type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "value_type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "getRoleAdmin", "decl_node": {"node_id": 72, "source_id": 0}, "access_path": []}]}, "src": "7315:23:0", "end_lineno": 213, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "getRoleAdmin", "decl_node": {"node_id": 72, "source_id": 0}, "access_path": ["$subscript_access"]}], "variable_writes": [{"name": "getRoleAdmin", "decl_node": {"node_id": 72, "source_id": 0}, "access_path": ["$subscript_access"]}]}}, {"node_id": 350, "lineno": 214, "col_offset": 4, "ast_type": "Log", "end_col_offset": 114, "value": {"args": [], "node_id": 351, "lineno": 214, "func": {"node_id": 352, "lineno": 214, "attr": "RoleAdminChanged", "col_offset": 8, "ast_type": "Attribute", "end_col_offset": 39, "value": {"node_id": 353, "id": "IAccessControl", "lineno": 214, "col_offset": 8, "ast_type": "Name", "end_col_offset": 22, "src": "7360:14:0", "end_lineno": 214, "type": {"type_t": {"name": "src/snekmate/auth/interfaces/IAccessControl.vyi", "type_decl_node": {"node_id": 0, "source_id": 1}, "typeclass": "interface"}}}, "src": "7360:31:0", "end_lineno": 214, "type": {"type_t": {"name": "RoleAdminChanged", "type_decl_node": {"node_id": 3, "source_id": 1}, "typeclass": "event"}}}, "col_offset": 8, "ast_type": "Call", "end_col_offset": 114, "keywords": [{"node_id": 356, "lineno": 214, "arg": "role", "col_offset": 40, "ast_type": "keyword", "end_col_offset": 49, "value": {"node_id": 357, "id": "role", "lineno": 214, "col_offset": 45, "ast_type": "Name", "end_col_offset": 49, "src": "7397:4:0", "end_lineno": 214, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "role", "decl_node": {"node_id": 317, "source_id": 0}, "access_path": []}]}, "src": "7392:9:0", "end_lineno": 214}, {"node_id": 359, "lineno": 214, "arg": "previousAdminRole", "col_offset": 51, "ast_type": "keyword", "end_col_offset": 88, "value": {"node_id": 360, "id": "previous_admin_role", "lineno": 214, "col_offset": 69, "ast_type": "Name", "end_col_offset": 88, "src": "7421:19:0", "end_lineno": 214, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "previous_admin_role", "decl_node": {"node_id": 325, "source_id": 0}, "access_path": []}]}, "src": "7403:37:0", "end_lineno": 214}, {"node_id": 362, "lineno": 214, "arg": "newAdminRole", "col_offset": 90, "ast_type": "keyword", "end_col_offset": 113, "value": {"node_id": 363, "id": "admin_role", "lineno": 214, "col_offset": 103, "ast_type": "Name", "end_col_offset": 113, "src": "7455:10:0", "end_lineno": 214, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "admin_role", "decl_node": {"node_id": 320, "source_id": 0}, "access_path": []}]}, "src": "7442:23:0", "end_lineno": 214}], "src": "7360:106:0", "end_lineno": 214, "type": {"name": "(void)"}}, "src": "7356:110:0", "end_lineno": 214, "type": {"name": "RoleAdminChanged", "type_decl_node": {"node_id": 3, "source_id": 1}, "typeclass": "event"}}], "ast_type": "FunctionDef", "end_col_offset": 114, "src": "6939:527:0", "decorator_list": [{"node_id": 365, "id": "internal", "lineno": 203, "col_offset": 1, "ast_type": "Name", "end_col_offset": 9, "src": "6930:8:0", "end_lineno": 203}], "doc_string": {"node_id": 367, "lineno": 205, "col_offset": 4, "ast_type": "DocStr", "end_col_offset": 7, "value": "\n @dev Sets `admin_role` as `role`'s admin role.\n @notice This is an `internal` function without\n access restriction.\n @param role The 32-byte role definition.\n @param admin_role The new 32-byte admin role definition.\n ", "src": "7000:251:0", "end_lineno": 211}, "returns": null, "end_lineno": 214, "name": "_set_role_admin"}, {"args": {"args": [{"node_id": 370, "lineno": 218, "arg": "role", "col_offset": 16, "ast_type": "arg", "end_col_offset": 29, "src": "7495:13:0", "end_lineno": 218, "annotation": {"node_id": 371, "id": "bytes32", "lineno": 218, "col_offset": 22, "ast_type": "Name", "end_col_offset": 29, "src": "7501:7:0", "end_lineno": 218}}, {"node_id": 373, "lineno": 218, "arg": "account", "col_offset": 31, "ast_type": "arg", "end_col_offset": 47, "src": "7510:16:0", "end_lineno": 218, "annotation": {"node_id": 374, "id": "address", "lineno": 218, "col_offset": 40, "ast_type": "Name", "end_col_offset": 47, "src": "7519:7:0", "end_lineno": 218}}], "node_id": 369, "default": null, "lineno": 218, "col_offset": 0, "defaults": [], "ast_type": "arguments", "end_col_offset": 85, "src": "7479:454:0", "end_lineno": 228}, "pos": null, "node_id": 368, "lineno": 218, "col_offset": 0, "body": [{"node_id": 378, "lineno": 226, "col_offset": 4, "body": [{"node_id": 393, "lineno": 227, "col_offset": 8, "ast_type": "Assign", "end_col_offset": 42, "value": {"node_id": 406, "lineno": 227, "col_offset": 38, "ast_type": "NameConstant", "end_col_offset": 42, "value": true, "src": "7843:4:0", "end_lineno": 227, "type": {"name": "bool"}}, "src": "7813:34:0", "end_lineno": 227, "target": {"node_id": 394, "lineno": 227, "col_offset": 8, "slice": {"node_id": 403, "id": "account", "lineno": 227, "col_offset": 27, "ast_type": "Name", "end_col_offset": 34, "src": "7832:7:0", "end_lineno": 227, "type": {"name": "address"}, "variable_reads": [{"name": "account", "decl_node": {"node_id": 373, "source_id": 0}, "access_path": []}]}, "ast_type": "Subscript", "end_col_offset": 35, "value": {"node_id": 395, "lineno": 227, "col_offset": 8, "slice": {"node_id": 400, "id": "role", "lineno": 227, "col_offset": 21, "ast_type": "Name", "end_col_offset": 25, "src": "7826:4:0", "end_lineno": 227, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "role", "decl_node": {"node_id": 370, "source_id": 0}, "access_path": []}]}, "ast_type": "Subscript", "end_col_offset": 26, "value": {"node_id": 396, "lineno": 227, "attr": "hasRole", "col_offset": 8, "ast_type": "Attribute", "end_col_offset": 20, "value": {"node_id": 397, "id": "self", "lineno": 227, "col_offset": 8, "ast_type": "Name", "end_col_offset": 12, "src": "7813:4:0", "end_lineno": 227, "type": {"name": "self"}}, "src": "7813:12:0", "end_lineno": 227, "type": {"key_type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "value_type": {"key_type": {"name": "address"}, "value_type": {"name": "bool"}, "name": "HashMap", "typeclass": "hashmap"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": []}]}, "src": "7813:18:0", "end_lineno": 227, "type": {"key_type": {"name": "address"}, "value_type": {"name": "bool"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "src": "7813:27:0", "end_lineno": 227, "type": {"name": "bool"}, "variable_reads": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}], "variable_writes": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}]}}, {"node_id": 408, "lineno": 228, "col_offset": 8, "ast_type": "Log", "end_col_offset": 85, "value": {"args": [], "node_id": 409, "lineno": 228, "func": {"node_id": 410, "lineno": 228, "attr": "RoleGranted", "col_offset": 12, "ast_type": "Attribute", "end_col_offset": 38, "value": {"node_id": 411, "id": "IAccessControl", "lineno": 228, "col_offset": 12, "ast_type": "Name", "end_col_offset": 26, "src": "7860:14:0", "end_lineno": 228, "type": {"type_t": {"name": "src/snekmate/auth/interfaces/IAccessControl.vyi", "type_decl_node": {"node_id": 0, "source_id": 1}, "typeclass": "interface"}}}, "src": "7860:26:0", "end_lineno": 228, "type": {"type_t": {"name": "RoleGranted", "type_decl_node": {"node_id": 28, "source_id": 1}, "typeclass": "event"}}}, "col_offset": 12, "ast_type": "Call", "end_col_offset": 85, "keywords": [{"node_id": 414, "lineno": 228, "arg": "role", "col_offset": 39, "ast_type": "keyword", "end_col_offset": 48, "value": {"node_id": 415, "id": "role", "lineno": 228, "col_offset": 44, "ast_type": "Name", "end_col_offset": 48, "src": "7892:4:0", "end_lineno": 228, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "role", "decl_node": {"node_id": 370, "source_id": 0}, "access_path": []}]}, "src": "7887:9:0", "end_lineno": 228}, {"node_id": 417, "lineno": 228, "arg": "account", "col_offset": 50, "ast_type": "keyword", "end_col_offset": 65, "value": {"node_id": 418, "id": "account", "lineno": 228, "col_offset": 58, "ast_type": "Name", "end_col_offset": 65, "src": "7906:7:0", "end_lineno": 228, "type": {"name": "address"}, "variable_reads": [{"name": "account", "decl_node": {"node_id": 373, "source_id": 0}, "access_path": []}]}, "src": "7898:15:0", "end_lineno": 228}, {"node_id": 420, "lineno": 228, "arg": "sender", "col_offset": 67, "ast_type": "keyword", "end_col_offset": 84, "value": {"node_id": 421, "lineno": 228, "attr": "sender", "col_offset": 74, "ast_type": "Attribute", "end_col_offset": 84, "value": {"node_id": 422, "id": "msg", "lineno": 228, "col_offset": 74, "ast_type": "Name", "end_col_offset": 77, "src": "7922:3:0", "end_lineno": 228, "type": {"name": "msg"}}, "src": "7922:10:0", "end_lineno": 228, "type": {"name": "address"}}, "src": "7915:17:0", "end_lineno": 228}], "src": "7860:73:0", "end_lineno": 228, "type": {"name": "(void)"}}, "src": "7856:77:0", "end_lineno": 228, "type": {"name": "RoleGranted", "type_decl_node": {"node_id": 28, "source_id": 1}, "typeclass": "event"}}], "test": {"node_id": 379, "lineno": 226, "op": {"node_id": 380, "lineno": 226, "col_offset": 7, "ast_type": "Not", "end_col_offset": 38, "src": "7772:31:0", "end_lineno": 226}, "col_offset": 7, "ast_type": "UnaryOp", "end_col_offset": 38, "src": "7772:31:0", "operand": {"node_id": 381, "lineno": 226, "col_offset": 11, "slice": {"node_id": 390, "id": "account", "lineno": 226, "col_offset": 30, "ast_type": "Name", "end_col_offset": 37, "src": "7795:7:0", "end_lineno": 226, "type": {"name": "address"}, "variable_reads": [{"name": "account", "decl_node": {"node_id": 373, "source_id": 0}, "access_path": []}]}, "ast_type": "Subscript", "end_col_offset": 38, "value": {"node_id": 382, "lineno": 226, "col_offset": 11, "slice": {"node_id": 387, "id": "role", "lineno": 226, "col_offset": 24, "ast_type": "Name", "end_col_offset": 28, "src": "7789:4:0", "end_lineno": 226, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "role", "decl_node": {"node_id": 370, "source_id": 0}, "access_path": []}]}, "ast_type": "Subscript", "end_col_offset": 29, "value": {"node_id": 383, "lineno": 226, "attr": "hasRole", "col_offset": 11, "ast_type": "Attribute", "end_col_offset": 23, "value": {"node_id": 384, "id": "self", "lineno": 226, "col_offset": 11, "ast_type": "Name", "end_col_offset": 15, "src": "7776:4:0", "end_lineno": 226, "type": {"name": "self"}}, "src": "7776:12:0", "end_lineno": 226, "type": {"key_type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "value_type": {"key_type": {"name": "address"}, "value_type": {"name": "bool"}, "name": "HashMap", "typeclass": "hashmap"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": []}]}, "src": "7776:18:0", "end_lineno": 226, "type": {"key_type": {"name": "address"}, "value_type": {"name": "bool"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "src": "7776:27:0", "end_lineno": 226, "type": {"name": "bool"}, "variable_reads": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}]}, "end_lineno": 226, "type": {"name": "bool"}}, "ast_type": "If", "end_col_offset": 85, "src": "7769:164:0", "end_lineno": 228, "orelse": []}], "ast_type": "FunctionDef", "end_col_offset": 85, "src": "7479:454:0", "decorator_list": [{"node_id": 425, "id": "internal", "lineno": 217, "col_offset": 1, "ast_type": "Name", "end_col_offset": 9, "src": "7470:8:0", "end_lineno": 217}], "doc_string": {"node_id": 427, "lineno": 219, "col_offset": 4, "ast_type": "DocStr", "end_col_offset": 7, "value": "\n @dev Grants `role` to `account`.\n @notice This is an `internal` function without\n access restriction.\n @param role The 32-byte role definition.\n @param account The 20-byte address of the account.\n ", "src": "7533:231:0", "end_lineno": 225}, "returns": null, "end_lineno": 228, "name": "_grant_role"}, {"args": {"args": [{"node_id": 430, "lineno": 232, "arg": "role", "col_offset": 17, "ast_type": "arg", "end_col_offset": 30, "src": "7963:13:0", "end_lineno": 232, "annotation": {"node_id": 431, "id": "bytes32", "lineno": 232, "col_offset": 23, "ast_type": "Name", "end_col_offset": 30, "src": "7969:7:0", "end_lineno": 232}}, {"node_id": 433, "lineno": 232, "arg": "account", "col_offset": 32, "ast_type": "arg", "end_col_offset": 48, "src": "7978:16:0", "end_lineno": 232, "annotation": {"node_id": 434, "id": "address", "lineno": 232, "col_offset": 41, "ast_type": "Name", "end_col_offset": 48, "src": "7987:7:0", "end_lineno": 232}}], "node_id": 429, "default": null, "lineno": 232, "col_offset": 0, "defaults": [], "ast_type": "arguments", "end_col_offset": 85, "src": "7946:455:0", "end_lineno": 242}, "pos": null, "node_id": 428, "lineno": 232, "col_offset": 0, "body": [{"node_id": 438, "lineno": 240, "col_offset": 4, "body": [{"node_id": 451, "lineno": 241, "col_offset": 8, "ast_type": "Assign", "end_col_offset": 43, "value": {"node_id": 464, "lineno": 241, "col_offset": 38, "ast_type": "NameConstant", "end_col_offset": 43, "value": false, "src": "8310:5:0", "end_lineno": 241, "type": {"name": "bool"}}, "src": "8280:35:0", "end_lineno": 241, "target": {"node_id": 452, "lineno": 241, "col_offset": 8, "slice": {"node_id": 461, "id": "account", "lineno": 241, "col_offset": 27, "ast_type": "Name", "end_col_offset": 34, "src": "8299:7:0", "end_lineno": 241, "type": {"name": "address"}, "variable_reads": [{"name": "account", "decl_node": {"node_id": 433, "source_id": 0}, "access_path": []}]}, "ast_type": "Subscript", "end_col_offset": 35, "value": {"node_id": 453, "lineno": 241, "col_offset": 8, "slice": {"node_id": 458, "id": "role", "lineno": 241, "col_offset": 21, "ast_type": "Name", "end_col_offset": 25, "src": "8293:4:0", "end_lineno": 241, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "role", "decl_node": {"node_id": 430, "source_id": 0}, "access_path": []}]}, "ast_type": "Subscript", "end_col_offset": 26, "value": {"node_id": 454, "lineno": 241, "attr": "hasRole", "col_offset": 8, "ast_type": "Attribute", "end_col_offset": 20, "value": {"node_id": 455, "id": "self", "lineno": 241, "col_offset": 8, "ast_type": "Name", "end_col_offset": 12, "src": "8280:4:0", "end_lineno": 241, "type": {"name": "self"}}, "src": "8280:12:0", "end_lineno": 241, "type": {"key_type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "value_type": {"key_type": {"name": "address"}, "value_type": {"name": "bool"}, "name": "HashMap", "typeclass": "hashmap"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": []}]}, "src": "8280:18:0", "end_lineno": 241, "type": {"key_type": {"name": "address"}, "value_type": {"name": "bool"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "src": "8280:27:0", "end_lineno": 241, "type": {"name": "bool"}, "variable_reads": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}], "variable_writes": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}]}}, {"node_id": 466, "lineno": 242, "col_offset": 8, "ast_type": "Log", "end_col_offset": 85, "value": {"args": [], "node_id": 467, "lineno": 242, "func": {"node_id": 468, "lineno": 242, "attr": "RoleRevoked", "col_offset": 12, "ast_type": "Attribute", "end_col_offset": 38, "value": {"node_id": 469, "id": "IAccessControl", "lineno": 242, "col_offset": 12, "ast_type": "Name", "end_col_offset": 26, "src": "8328:14:0", "end_lineno": 242, "type": {"type_t": {"name": "src/snekmate/auth/interfaces/IAccessControl.vyi", "type_decl_node": {"node_id": 0, "source_id": 1}, "typeclass": "interface"}}}, "src": "8328:26:0", "end_lineno": 242, "type": {"type_t": {"name": "RoleRevoked", "type_decl_node": {"node_id": 53, "source_id": 1}, "typeclass": "event"}}}, "col_offset": 12, "ast_type": "Call", "end_col_offset": 85, "keywords": [{"node_id": 472, "lineno": 242, "arg": "role", "col_offset": 39, "ast_type": "keyword", "end_col_offset": 48, "value": {"node_id": 473, "id": "role", "lineno": 242, "col_offset": 44, "ast_type": "Name", "end_col_offset": 48, "src": "8360:4:0", "end_lineno": 242, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "role", "decl_node": {"node_id": 430, "source_id": 0}, "access_path": []}]}, "src": "8355:9:0", "end_lineno": 242}, {"node_id": 475, "lineno": 242, "arg": "account", "col_offset": 50, "ast_type": "keyword", "end_col_offset": 65, "value": {"node_id": 476, "id": "account", "lineno": 242, "col_offset": 58, "ast_type": "Name", "end_col_offset": 65, "src": "8374:7:0", "end_lineno": 242, "type": {"name": "address"}, "variable_reads": [{"name": "account", "decl_node": {"node_id": 433, "source_id": 0}, "access_path": []}]}, "src": "8366:15:0", "end_lineno": 242}, {"node_id": 478, "lineno": 242, "arg": "sender", "col_offset": 67, "ast_type": "keyword", "end_col_offset": 84, "value": {"node_id": 479, "lineno": 242, "attr": "sender", "col_offset": 74, "ast_type": "Attribute", "end_col_offset": 84, "value": {"node_id": 480, "id": "msg", "lineno": 242, "col_offset": 74, "ast_type": "Name", "end_col_offset": 77, "src": "8390:3:0", "end_lineno": 242, "type": {"name": "msg"}}, "src": "8390:10:0", "end_lineno": 242, "type": {"name": "address"}}, "src": "8383:17:0", "end_lineno": 242}], "src": "8328:73:0", "end_lineno": 242, "type": {"name": "(void)"}}, "src": "8324:77:0", "end_lineno": 242, "type": {"name": "RoleRevoked", "type_decl_node": {"node_id": 53, "source_id": 1}, "typeclass": "event"}}], "test": {"node_id": 439, "lineno": 240, "col_offset": 7, "slice": {"node_id": 448, "id": "account", "lineno": 240, "col_offset": 26, "ast_type": "Name", "end_col_offset": 33, "src": "8262:7:0", "end_lineno": 240, "type": {"name": "address"}, "variable_reads": [{"name": "account", "decl_node": {"node_id": 433, "source_id": 0}, "access_path": []}]}, "ast_type": "Subscript", "end_col_offset": 34, "value": {"node_id": 440, "lineno": 240, "col_offset": 7, "slice": {"node_id": 445, "id": "role", "lineno": 240, "col_offset": 20, "ast_type": "Name", "end_col_offset": 24, "src": "8256:4:0", "end_lineno": 240, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "role", "decl_node": {"node_id": 430, "source_id": 0}, "access_path": []}]}, "ast_type": "Subscript", "end_col_offset": 25, "value": {"node_id": 441, "lineno": 240, "attr": "hasRole", "col_offset": 7, "ast_type": "Attribute", "end_col_offset": 19, "value": {"node_id": 442, "id": "self", "lineno": 240, "col_offset": 7, "ast_type": "Name", "end_col_offset": 11, "src": "8243:4:0", "end_lineno": 240, "type": {"name": "self"}}, "src": "8243:12:0", "end_lineno": 240, "type": {"key_type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "value_type": {"key_type": {"name": "address"}, "value_type": {"name": "bool"}, "name": "HashMap", "typeclass": "hashmap"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": []}]}, "src": "8243:18:0", "end_lineno": 240, "type": {"key_type": {"name": "address"}, "value_type": {"name": "bool"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "src": "8243:27:0", "end_lineno": 240, "type": {"name": "bool"}, "variable_reads": [{"name": "hasRole", "decl_node": {"node_id": 48, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}]}, "ast_type": "If", "end_col_offset": 85, "src": "8240:161:0", "end_lineno": 242, "orelse": []}], "ast_type": "FunctionDef", "end_col_offset": 85, "src": "7946:455:0", "decorator_list": [{"node_id": 483, "id": "internal", "lineno": 231, "col_offset": 1, "ast_type": "Name", "end_col_offset": 9, "src": "7937:8:0", "end_lineno": 231}], "doc_string": {"node_id": 485, "lineno": 233, "col_offset": 4, "ast_type": "DocStr", "end_col_offset": 7, "value": "\n @dev Revokes `role` from `account`.\n @notice This is an `internal` function without\n access restriction.\n @param role The 32-byte role definition.\n @param account The 20-byte address of the account.\n ", "src": "8001:234:0", "end_lineno": 239}, "returns": null, "end_lineno": 242, "name": "_revoke_role"}], "ast_type": "Module", "end_col_offset": 84, "src": "0:8400:0", "doc_string": {"node_id": 486, "lineno": 3, "col_offset": 0, "ast_type": "DocStr", "end_col_offset": 3, "value": "\n@title Multi-Role-Based Access Control Functions\n@custom:contract-name access_control\n@license GNU Affero General Public License v3.0 only\n@author pcaversaccio\n@notice These functions can be used to implement role-based access\n control mechanisms. Roles are referred to by their `bytes32`\n identifier. These should be exposed in the external API and\n be unique. The best way to achieve this is by using `public`\n `constant` hash digests:\n ```vy\n MY_ROLE: public(constant(bytes32)) = keccak256(\"MY_ROLE\");\n ```\n\n Roles can be used to represent a set of permissions. To restrict\n access to a function call, use the `external` function `hasRole`\n or the `internal` function `_check_role` (to avoid any NatSpec\n parsing error, no `@` character is added to the visibility decorator\n `@external` in the following examples; please add them accordingly):\n ```vy\n from ethereum.ercs import IERC165\n implements: IERC165\n\n from snekmate.auth.interfaces import IAccessControl\n implements: IAccessControl\n\n from snekmate.auth import access_control\n initializes: access_control\n\n exports: access_control.__interface__\n\n ...\n\n external\n def foo():\n assert access_control.hasRole[MY_ROLE][msg.sender], \"access_control: account is missing role\"\n ...\n\n OR\n\n external\n def foo():\n access_control._check_role(MY_ROLE, msg.sender)\n ...\n ```\n\n Roles can be granted and revoked dynamically via the `grantRole`\n and `revokeRole` functions. Each role has an associated admin role,\n and only accounts that have a role's admin role can call `grantRole`\n and `revokeRole`. Also, by default, the admin role for all roles is\n `DEFAULT_ADMIN_ROLE`, which means that only accounts with this role\n will be able to grant or revoke other roles. More complex role\n relationships can be created by using `set_role_admin`.\n\n WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin! It has\n permission to grant and revoke this role. Extra precautions should be\n taken to secure accounts that have been granted it.\n\n The implementation is inspired by OpenZeppelin's implementation here:\n https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/AccessControl.sol.\n", "src": "52:2475:0", "end_lineno": 63}, "is_interface": false, "end_lineno": 242, "name": null, "path": "src/snekmate/auth/access_control.vy", "settings": {"nonreentrancy_by_default": false}, "type": {"name": "src/snekmate/auth/access_control.vy", "type_decl_node": {"node_id": 0, "source_id": 0}, "typeclass": "module"}} \ No newline at end of file diff --git a/test-data/vyper_ast/break.json b/test-data/vyper_ast/break.json new file mode 100644 index 000000000..c5187f54f --- /dev/null +++ b/test-data/vyper_ast/break.json @@ -0,0 +1 @@ +{"source_sha256sum": "46d6e56ad42d2ef92cb291cf31623803376a5708ed035d48f2bc047690f1d366", "ast_type": "Module", "path": "break.vy", "resolved_path": "/tmp/vyper_samples/break.vy", "end_col_offset": 12, "doc_string": null, "settings": {}, "end_lineno": 3, "is_interface": false, "source_id": 0, "name": null, "node_id": 0, "col_offset": 0, "lineno": 1, "body": [{"decorator_list": [], "ast_type": "FunctionDef", "end_col_offset": 11, "returns": null, "args": {"ast_type": "arguments", "end_col_offset": 11, "args": [], "end_lineno": 3, "node_id": 2, "col_offset": 0, "default": null, "lineno": 1, "defaults": [], "src": "0:55:0"}, "doc_string": null, "end_lineno": 3, "name": "loop", "node_id": 1, "col_offset": 0, "lineno": 1, "pos": null, "body": [{"ast_type": "For", "end_col_offset": 11, "end_lineno": 3, "node_id": 3, "col_offset": 2, "lineno": 2, "target": {"ast_type": "AnnAssign", "end_col_offset": 15, "annotation": {"ast_type": "Name", "end_col_offset": 15, "end_lineno": 2, "node_id": 7, "col_offset": 9, "id": "int128", "lineno": 2, "src": "21:6:0"}, "end_lineno": 2, "node_id": 4, "col_offset": 0, "lineno": 1, "target": {"ast_type": "Name", "end_col_offset": 7, "end_lineno": 2, "node_id": 5, "col_offset": 6, "id": "i", "lineno": 2, "src": "18:1:0", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}, "variable_reads": [{"name": "i", "decl_node": {"node_id": 4, "source_id": 0}, "access_path": []}]}, "value": null, "src": "0:27:0"}, "body": [{"ast_type": "Break", "end_col_offset": 11, "end_lineno": 3, "node_id": 14, "col_offset": 6, "lineno": 3, "src": "50:5:0"}], "src": "14:41:0", "iter": {"ast_type": "List", "end_col_offset": 30, "end_lineno": 2, "node_id": 9, "col_offset": 19, "lineno": 2, "elements": [{"ast_type": "Int", "end_col_offset": 21, "end_lineno": 2, "node_id": 10, "col_offset": 20, "lineno": 2, "value": 4, "src": "32:1:0", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}}, {"ast_type": "Int", "end_col_offset": 25, "end_lineno": 2, "node_id": 11, "col_offset": 23, "lineno": 2, "value": 23, "src": "35:2:0", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}}, {"ast_type": "Int", "end_col_offset": 29, "end_lineno": 2, "node_id": 12, "col_offset": 27, "lineno": 2, "value": 42, "src": "39:2:0", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}}], "src": "31:11:0", "type": {"value_type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}, "length": 3, "name": "$SArray", "typeclass": "static_array"}}}], "src": "0:55:0"}], "src": "0:56:0", "type": {"name": "break.vy", "type_decl_node": {"node_id": 0, "source_id": 0}, "typeclass": "module"}} \ No newline at end of file diff --git a/test-data/vyper_ast/calls.json b/test-data/vyper_ast/calls.json new file mode 100644 index 000000000..c3fac2b5b --- /dev/null +++ b/test-data/vyper_ast/calls.json @@ -0,0 +1 @@ +{"source_sha256sum": "e5f33d825c375a4c97fb022af85ef74ba9009183d4ddec874c0699c6fc496785", "source_id": 0, "body": [{"lineno": 1, "col_offset": 0, "end_lineno": 1, "src": "0:32:0", "ast_type": "ImportFrom", "module": "ethereum.ercs", "level": 0, "node_id": 1, "end_col_offset": 32, "alias": null, "name": "IERC20", "import_info": {"alias": "IERC20", "qualified_module_name": "ethereum.ercs.IERC20", "source_id": -2, "path": "vyper/builtins/interfaces/IERC20.vyi", "resolved_path": "/home/francois/.local/share/uv/tools/vyper/lib/python3.12/site-packages/vyper/builtins/interfaces/IERC20.vyi", "file_sha256sum": "4b175cac05c3e50785083c1020c5cd371a9d5b967f7c7c8e921fabc890497482"}}, {"body": [{"lineno": 5, "end_lineno": 5, "src": "112:38:0", "ast_type": "Return", "value": {"lineno": 5, "end_lineno": 5, "src": "119:31:0", "ast_type": "ExtCall", "value": {"func": {"lineno": 5, "end_lineno": 5, "attr": "transfer", "src": "127:14:0", "ast_type": "Attribute", "value": {"lineno": 5, "id": "token", "end_lineno": 5, "src": "127:5:0", "ast_type": "Name", "node_id": 18, "end_col_offset": 24, "col_offset": 19, "type": {"name": "/home/francois/.local/share/uv/tools/vyper/lib/python3.12/site-packages/vyper/builtins/interfaces/IERC20.vyi", "type_decl_node": {"node_id": 0, "source_id": -2}, "typeclass": "interface"}, "variable_reads": [{"name": "token", "decl_node": {"node_id": 5, "source_id": 0}, "access_path": []}]}, "node_id": 17, "end_col_offset": 33, "col_offset": 19, "type": {"name": "transfer", "type_decl_node": {"node_id": 78, "source_id": -2}, "typeclass": "contract_function"}, "variable_reads": [{"name": "token", "decl_node": {"node_id": 5, "source_id": 0}, "access_path": ["transfer"]}]}, "lineno": 5, "end_lineno": 5, "src": "127:23:0", "ast_type": "Call", "keywords": [], "node_id": 16, "end_col_offset": 42, "col_offset": 19, "args": [{"lineno": 5, "id": "to", "end_lineno": 5, "src": "142:2:0", "ast_type": "Name", "node_id": 21, "end_col_offset": 36, "col_offset": 34, "type": {"name": "address"}, "variable_reads": [{"name": "to", "decl_node": {"node_id": 8, "source_id": 0}, "access_path": []}]}, {"lineno": 5, "id": "wad", "end_lineno": 5, "src": "146:3:0", "ast_type": "Name", "node_id": 23, "end_col_offset": 41, "col_offset": 38, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "wad", "decl_node": {"node_id": 11, "source_id": 0}, "access_path": []}]}], "type": {"name": "bool"}}, "node_id": 15, "end_col_offset": 42, "col_offset": 11, "type": {"name": "bool"}}, "node_id": 14, "end_col_offset": 42, "col_offset": 4}], "decorator_list": [{"lineno": 3, "id": "external", "end_lineno": 3, "src": "35:8:0", "ast_type": "Name", "node_id": 25, "end_col_offset": 9, "col_offset": 1}], "lineno": 4, "doc_string": null, "col_offset": 0, "end_lineno": 5, "src": "44:106:0", "ast_type": "FunctionDef", "name": "transfer", "node_id": 3, "end_col_offset": 42, "pos": null, "args": {"lineno": 4, "end_lineno": 5, "default": null, "src": "44:106:0", "defaults": [], "ast_type": "arguments", "node_id": 4, "end_col_offset": 42, "col_offset": 0, "args": [{"annotation": {"lineno": 4, "id": "IERC20", "end_lineno": 4, "src": "64:6:0", "ast_type": "Name", "node_id": 6, "end_col_offset": 26, "col_offset": 20}, "lineno": 4, "arg": "token", "end_lineno": 4, "src": "57:13:0", "ast_type": "arg", "node_id": 5, "end_col_offset": 26, "col_offset": 13}, {"annotation": {"lineno": 4, "id": "address", "end_lineno": 4, "src": "76:7:0", "ast_type": "Name", "node_id": 9, "end_col_offset": 39, "col_offset": 32}, "lineno": 4, "arg": "to", "end_lineno": 4, "src": "72:11:0", "ast_type": "arg", "node_id": 8, "end_col_offset": 39, "col_offset": 28}, {"annotation": {"lineno": 4, "id": "uint256", "end_lineno": 4, "src": "90:7:0", "ast_type": "Name", "node_id": 12, "end_col_offset": 53, "col_offset": 46}, "lineno": 4, "arg": "wad", "end_lineno": 4, "src": "85:12:0", "ast_type": "arg", "node_id": 11, "end_col_offset": 53, "col_offset": 41}]}, "returns": {"lineno": 4, "id": "bool", "end_lineno": 4, "src": "102:4:0", "ast_type": "Name", "node_id": 27, "end_col_offset": 62, "col_offset": 58}}, {"body": [{"lineno": 9, "end_lineno": 9, "src": "209:39:0", "ast_type": "Return", "value": {"lineno": 9, "end_lineno": 9, "src": "216:32:0", "ast_type": "StaticCall", "value": {"func": {"lineno": 9, "end_lineno": 9, "attr": "balanceOf", "src": "227:15:0", "ast_type": "Attribute", "value": {"lineno": 9, "id": "token", "end_lineno": 9, "src": "227:5:0", "ast_type": "Name", "node_id": 38, "end_col_offset": 27, "col_offset": 22, "type": {"name": "/home/francois/.local/share/uv/tools/vyper/lib/python3.12/site-packages/vyper/builtins/interfaces/IERC20.vyi", "type_decl_node": {"node_id": 0, "source_id": -2}, "typeclass": "interface"}, "variable_reads": [{"name": "token", "decl_node": {"node_id": 31, "source_id": 0}, "access_path": []}]}, "node_id": 37, "end_col_offset": 37, "col_offset": 22, "type": {"name": "balanceOf", "type_decl_node": {"node_id": 53, "source_id": -2}, "typeclass": "contract_function"}, "variable_reads": [{"name": "token", "decl_node": {"node_id": 31, "source_id": 0}, "access_path": ["balanceOf"]}]}, "lineno": 9, "end_lineno": 9, "src": "227:21:0", "ast_type": "Call", "keywords": [], "node_id": 36, "end_col_offset": 43, "col_offset": 22, "args": [{"lineno": 9, "id": "self", "end_lineno": 9, "src": "243:4:0", "ast_type": "Name", "node_id": 41, "end_col_offset": 42, "col_offset": 38, "type": {"name": "address"}}], "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "node_id": 35, "end_col_offset": 43, "col_offset": 11, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "node_id": 34, "end_col_offset": 43, "col_offset": 4}], "decorator_list": [{"lineno": 7, "id": "external", "end_lineno": 7, "src": "153:8:0", "ast_type": "Name", "node_id": 43, "end_col_offset": 9, "col_offset": 1}], "lineno": 8, "doc_string": null, "col_offset": 0, "end_lineno": 9, "src": "162:86:0", "ast_type": "FunctionDef", "name": "get_balance", "node_id": 29, "end_col_offset": 43, "pos": null, "args": {"lineno": 8, "end_lineno": 9, "default": null, "src": "162:86:0", "defaults": [], "ast_type": "arguments", "node_id": 30, "end_col_offset": 43, "col_offset": 0, "args": [{"annotation": {"lineno": 8, "id": "IERC20", "end_lineno": 8, "src": "185:6:0", "ast_type": "Name", "node_id": 32, "end_col_offset": 29, "col_offset": 23}, "lineno": 8, "arg": "token", "end_lineno": 8, "src": "178:13:0", "ast_type": "arg", "node_id": 31, "end_col_offset": 29, "col_offset": 16}]}, "returns": {"lineno": 8, "id": "uint256", "end_lineno": 8, "src": "196:7:0", "ast_type": "Name", "node_id": 45, "end_col_offset": 41, "col_offset": 34}}], "lineno": 1, "doc_string": null, "col_offset": 0, "end_lineno": 9, "path": "calls.vy", "src": "0:249:0", "ast_type": "Module", "settings": {}, "resolved_path": "/tmp/vyper_samples/calls.vy", "node_id": 0, "end_col_offset": 44, "is_interface": false, "name": null, "type": {"name": "calls.vy", "type_decl_node": {"node_id": 0, "source_id": 0}, "typeclass": "module"}} \ No newline at end of file diff --git a/test-data/vyper_ast/continue.json b/test-data/vyper_ast/continue.json new file mode 100644 index 000000000..92bac3d1c --- /dev/null +++ b/test-data/vyper_ast/continue.json @@ -0,0 +1 @@ +{"source_sha256sum": "59f5ed13cbb499ca35cb83ff2b6901f806101423feca0b005f46fde1630052d9", "node_id": 0, "source_id": 0, "col_offset": 0, "end_lineno": 3, "settings": {}, "is_interface": false, "body": [{"node_id": 1, "decorator_list": [], "col_offset": 0, "end_lineno": 3, "body": [{"node_id": 3, "iter": {"elements": [{"node_id": 10, "col_offset": 20, "end_lineno": 2, "value": 4, "ast_type": "Int", "lineno": 2, "src": "32:1:0", "end_col_offset": 21, "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}}, {"node_id": 11, "col_offset": 23, "end_lineno": 2, "value": 23, "ast_type": "Int", "lineno": 2, "src": "35:2:0", "end_col_offset": 25, "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}}, {"node_id": 12, "col_offset": 27, "end_lineno": 2, "value": 42, "ast_type": "Int", "lineno": 2, "src": "39:2:0", "end_col_offset": 29, "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}}], "node_id": 9, "col_offset": 19, "end_lineno": 2, "ast_type": "List", "lineno": 2, "src": "31:11:0", "end_col_offset": 30, "type": {"value_type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}, "length": 3, "name": "$SArray", "typeclass": "static_array"}}, "col_offset": 2, "end_lineno": 3, "target": {"node_id": 4, "col_offset": 0, "end_lineno": 2, "target": {"node_id": 5, "col_offset": 6, "end_lineno": 2, "ast_type": "Name", "id": "i", "lineno": 2, "src": "18:1:0", "end_col_offset": 7, "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}, "variable_reads": [{"name": "i", "decl_node": {"node_id": 4, "source_id": 0}, "access_path": []}]}, "annotation": {"node_id": 7, "col_offset": 9, "end_lineno": 2, "ast_type": "Name", "id": "int128", "lineno": 2, "src": "21:6:0", "end_col_offset": 15}, "value": null, "ast_type": "AnnAssign", "lineno": 1, "src": "0:27:0", "end_col_offset": 15}, "body": [{"node_id": 14, "col_offset": 6, "end_lineno": 3, "ast_type": "Continue", "lineno": 3, "src": "50:8:0", "end_col_offset": 14}], "ast_type": "For", "lineno": 2, "src": "14:44:0", "end_col_offset": 14}], "args": {"node_id": 2, "col_offset": 0, "end_lineno": 3, "default": null, "defaults": [], "args": [], "ast_type": "arguments", "lineno": 1, "src": "0:58:0", "end_col_offset": 14}, "doc_string": null, "ast_type": "FunctionDef", "pos": null, "src": "0:58:0", "lineno": 1, "returns": null, "end_col_offset": 14, "name": "loop"}], "resolved_path": "/tmp/vyper_samples/continue.vy", "ast_type": "Module", "path": "continue.vy", "src": "0:59:0", "lineno": 1, "doc_string": null, "end_col_offset": 15, "name": null, "type": {"name": "continue.vy", "type_decl_node": {"node_id": 0, "source_id": 0}, "typeclass": "module"}} \ No newline at end of file diff --git a/test-data/vyper_ast/erc20.json b/test-data/vyper_ast/erc20.json new file mode 100644 index 000000000..5126a2b8b --- /dev/null +++ b/test-data/vyper_ast/erc20.json @@ -0,0 +1 @@ +{"source_sha256sum": "0eeedc89ad663a421a3ed91ccd38a7741c497affc243ef36301d8f5dfc9e7ee9", "ast_type": "Module", "col_offset": 0, "settings": {"nonreentrancy_by_default": false}, "path": "src/snekmate/tokens/erc20.vy", "body": [{"ast_type": "ImportFrom", "col_offset": 0, "lineno": 57, "level": 0, "end_col_offset": 32, "module": "ethereum.ercs", "src": "2872:32:0", "end_lineno": 57, "node_id": 3, "name": "IERC20", "alias": null, "import_info": {"alias": "IERC20", "qualified_module_name": "ethereum.ercs.IERC20", "source_id": -2, "path": "vyper/builtins/interfaces/IERC20.vyi", "resolved_path": "/home/user/.local/share/uv/tools/vyper/lib/python3.12/site-packages/vyper/builtins/interfaces/IERC20.vyi", "file_sha256sum": "4b175cac05c3e50785083c1020c5cd371a9d5b967f7c7c8e921fabc890497482"}}, {"ast_type": "ImplementsDecl", "col_offset": 0, "lineno": 58, "annotation": {"ast_type": "Name", "col_offset": 12, "id": "IERC20", "lineno": 58, "end_col_offset": 18, "src": "2917:6:0", "end_lineno": 58, "node_id": 8}, "end_col_offset": 18, "src": "2905:18:0", "end_lineno": 58, "node_id": 5}, {"ast_type": "ImportFrom", "col_offset": 0, "lineno": 63, "level": 0, "end_col_offset": 40, "module": "ethereum.ercs", "src": "3044:40:0", "end_lineno": 63, "node_id": 10, "name": "IERC20Detailed", "alias": null, "import_info": {"alias": "IERC20Detailed", "qualified_module_name": "ethereum.ercs.IERC20Detailed", "source_id": -2, "path": "vyper/builtins/interfaces/IERC20Detailed.vyi", "resolved_path": "/home/user/.local/share/uv/tools/vyper/lib/python3.12/site-packages/vyper/builtins/interfaces/IERC20Detailed.vyi", "file_sha256sum": "bf5b580e012d8cfbd5b17772c03027255ab35263ff12861a97005f278e4921cb"}}, {"ast_type": "ImplementsDecl", "col_offset": 0, "lineno": 64, "annotation": {"ast_type": "Name", "col_offset": 12, "id": "IERC20Detailed", "lineno": 64, "end_col_offset": 26, "src": "3097:14:0", "end_lineno": 64, "node_id": 15}, "end_col_offset": 26, "src": "3085:26:0", "end_lineno": 64, "node_id": 12}, {"ast_type": "ImportFrom", "col_offset": 0, "lineno": 70, "level": 1, "end_col_offset": 36, "module": "interfaces", "src": "3225:36:0", "end_lineno": 70, "node_id": 17, "name": "IERC20Permit", "alias": null, "import_info": {"alias": "IERC20Permit", "qualified_module_name": "interfaces.IERC20Permit", "source_id": 1, "path": "interfaces/IERC20Permit.vyi", "resolved_path": "/home/user/tmp/snekmate/src/snekmate/tokens/interfaces/IERC20Permit.vyi", "file_sha256sum": "27e10fa233a268b5ad7f5a2594c3a502670149fb873af5560f56cb1a057feb23"}}, {"ast_type": "ImplementsDecl", "col_offset": 0, "lineno": 71, "annotation": {"ast_type": "Name", "col_offset": 12, "id": "IERC20Permit", "lineno": 71, "end_col_offset": 24, "src": "3274:12:0", "end_lineno": 71, "node_id": 22}, "end_col_offset": 24, "src": "3262:24:0", "end_lineno": 71, "node_id": 19}, {"ast_type": "ImportFrom", "col_offset": 0, "lineno": 76, "level": 2, "end_col_offset": 39, "module": "utils.interfaces", "src": "3394:39:0", "end_lineno": 76, "node_id": 24, "name": "IERC5267", "alias": null, "import_info": {"alias": "IERC5267", "qualified_module_name": "utils.interfaces.IERC5267", "source_id": 2, "path": "../utils/interfaces/IERC5267.vyi", "resolved_path": "/home/user/tmp/snekmate/src/snekmate/utils/interfaces/IERC5267.vyi", "file_sha256sum": "f8a14596daca6c34792d9bc2df7319258386cde7359eb9157484757154b4550e"}}, {"ast_type": "ImplementsDecl", "col_offset": 0, "lineno": 77, "annotation": {"ast_type": "Name", "col_offset": 12, "id": "IERC5267", "lineno": 77, "end_col_offset": 20, "src": "3446:8:0", "end_lineno": 77, "node_id": 29}, "end_col_offset": 20, "src": "3434:20:0", "end_lineno": 77, "node_id": 26}, {"ast_type": "ImportFrom", "col_offset": 0, "lineno": 81, "level": 2, "end_col_offset": 26, "module": "auth", "src": "3504:26:0", "end_lineno": 81, "node_id": 31, "name": "ownable", "alias": null, "import_info": {"alias": "ownable", "qualified_module_name": "auth.ownable", "source_id": 3, "path": "../auth/ownable.vy", "resolved_path": "/home/user/tmp/snekmate/src/snekmate/auth/ownable.vy", "file_sha256sum": "2bebfade7e8fab0293285cac09686d2747423553081e45dd9f35b25801253dc1"}}, {"ast_type": "UsesDecl", "col_offset": 0, "lineno": 82, "annotation": {"ast_type": "Name", "col_offset": 6, "id": "ownable", "lineno": 82, "end_col_offset": 13, "src": "3537:7:0", "end_lineno": 82, "node_id": 36}, "end_col_offset": 13, "src": "3531:13:0", "end_lineno": 82, "node_id": 33}, {"ast_type": "ImportFrom", "col_offset": 0, "lineno": 89, "level": 2, "end_col_offset": 25, "module": "utils", "src": "3708:25:0", "end_lineno": 89, "node_id": 38, "name": "ecdsa", "alias": null, "import_info": {"alias": "ecdsa", "qualified_module_name": "utils.ecdsa", "source_id": 4, "path": "../utils/ecdsa.vy", "resolved_path": "/home/user/tmp/snekmate/src/snekmate/utils/ecdsa.vy", "file_sha256sum": "833c605b78ecd9b9f28703d47458cc13ec08acc80aae6be51527002f8979695f"}}, {"ast_type": "ImportFrom", "col_offset": 0, "lineno": 93, "level": 2, "end_col_offset": 43, "module": "utils", "src": "3806:43:0", "end_lineno": 93, "node_id": 40, "name": "eip712_domain_separator", "alias": null, "import_info": {"alias": "eip712_domain_separator", "qualified_module_name": "utils.eip712_domain_separator", "source_id": 5, "path": "../utils/eip712_domain_separator.vy", "resolved_path": "/home/user/tmp/snekmate/src/snekmate/utils/eip712_domain_separator.vy", "file_sha256sum": "d1394de1341b3427a40a4a4054054972944f08eb0f91f669e00d6bd63c4c5f4f"}}, {"ast_type": "InitializesDecl", "col_offset": 0, "lineno": 94, "annotation": {"ast_type": "Name", "col_offset": 13, "id": "eip712_domain_separator", "lineno": 94, "end_col_offset": 36, "src": "3863:23:0", "end_lineno": 94, "node_id": 45}, "end_col_offset": 36, "src": "3850:36:0", "end_lineno": 94, "node_id": 42}, {"ast_type": "ExportsDecl", "col_offset": 0, "lineno": 107, "annotation": {"ast_type": "Tuple", "col_offset": 9, "lineno": 107, "end_col_offset": 1, "src": "4449:316:0", "elements": [{"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "ownable", "lineno": 112, "end_col_offset": 11, "src": "4707:7:0", "end_lineno": 112, "node_id": 52}, "lineno": 112, "end_col_offset": 17, "src": "4707:13:0", "end_lineno": 112, "node_id": 51, "attr": "owner"}, {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "eip712_domain_separator", "lineno": 113, "end_col_offset": 27, "src": "4726:23:0", "end_lineno": 113, "node_id": 56}, "lineno": 113, "end_col_offset": 40, "src": "4726:36:0", "end_lineno": 113, "node_id": 55, "attr": "eip712Domain"}], "end_lineno": 114, "node_id": 50}, "end_col_offset": 1, "src": "4440:325:0", "end_lineno": 114, "node_id": 47}, {"target": {"ast_type": "Name", "col_offset": 0, "id": "_PERMIT_TYPE_HASH", "lineno": 118, "end_col_offset": 17, "src": "4823:17:0", "end_lineno": 118, "node_id": 61}, "is_reentrant": false, "ast_type": "VariableDecl", "col_offset": 0, "is_public": false, "is_immutable": false, "value": {"ast_type": "Call", "col_offset": 39, "args": [{"ast_type": "Str", "col_offset": 4, "value": "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)", "lineno": 119, "end_col_offset": 88, "src": "4877:84:0", "end_lineno": 119, "node_id": 71, "type": {"length": 82, "name": "String", "typeclass": "string"}}], "lineno": 118, "end_col_offset": 1, "keywords": [], "src": "4862:101:0", "end_lineno": 120, "func": {"ast_type": "Name", "col_offset": 39, "id": "keccak256", "lineno": 118, "end_col_offset": 48, "src": "4862:9:0", "end_lineno": 118, "node_id": 69, "type": {"name": "keccak256", "typeclass": "builtin_function"}}, "node_id": 68, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}}, "is_constant": true, "lineno": 118, "annotation": {"ast_type": "Name", "col_offset": 28, "id": "bytes32", "lineno": 118, "end_col_offset": 35, "src": "4851:7:0", "end_lineno": 118, "node_id": 66}, "end_col_offset": 1, "src": "4823:140:0", "is_transient": false, "node_id": 60, "end_lineno": 120, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}}, {"target": {"ast_type": "Name", "col_offset": 0, "id": "name", "lineno": 132, "end_col_offset": 4, "src": "5351:4:0", "end_lineno": 132, "node_id": 73, "type": {"length": 25, "name": "String", "typeclass": "string"}}, "is_reentrant": false, "ast_type": "VariableDecl", "col_offset": 0, "is_public": true, "is_immutable": true, "value": null, "is_constant": false, "lineno": 132, "annotation": {"ast_type": "Subscript", "col_offset": 23, "value": {"ast_type": "Name", "col_offset": 23, "id": "String", "lineno": 132, "end_col_offset": 29, "src": "5374:6:0", "end_lineno": 132, "node_id": 82}, "lineno": 132, "end_col_offset": 33, "src": "5374:10:0", "slice": {"ast_type": "Int", "col_offset": 30, "value": 25, "lineno": 132, "end_col_offset": 32, "src": "5381:2:0", "end_lineno": 132, "node_id": 84}, "end_lineno": 132, "node_id": 81}, "end_col_offset": 35, "src": "5351:35:0", "is_transient": false, "node_id": 72, "end_lineno": 132, "type": {"length": 25, "name": "String", "typeclass": "string"}}, {"target": {"ast_type": "Name", "col_offset": 0, "id": "symbol", "lineno": 138, "end_col_offset": 6, "src": "5492:6:0", "end_lineno": 138, "node_id": 87, "type": {"length": 5, "name": "String", "typeclass": "string"}}, "is_reentrant": false, "ast_type": "VariableDecl", "col_offset": 0, "is_public": true, "is_immutable": true, "value": null, "is_constant": false, "lineno": 138, "annotation": {"ast_type": "Subscript", "col_offset": 25, "value": {"ast_type": "Name", "col_offset": 25, "id": "String", "lineno": 138, "end_col_offset": 31, "src": "5517:6:0", "end_lineno": 138, "node_id": 96}, "lineno": 138, "end_col_offset": 34, "src": "5517:9:0", "slice": {"ast_type": "Int", "col_offset": 32, "value": 5, "lineno": 138, "end_col_offset": 33, "src": "5524:1:0", "end_lineno": 138, "node_id": 98}, "end_lineno": 138, "node_id": 95}, "end_col_offset": 36, "src": "5492:36:0", "is_transient": false, "node_id": 86, "end_lineno": 138, "type": {"length": 5, "name": "String", "typeclass": "string"}}, {"target": {"ast_type": "Name", "col_offset": 0, "id": "decimals", "lineno": 144, "end_col_offset": 8, "src": "5642:8:0", "end_lineno": 144, "node_id": 101, "type": {"is_signed": false, "bits": 8, "name": "uint8", "typeclass": "integer"}}, "is_reentrant": false, "ast_type": "VariableDecl", "col_offset": 0, "is_public": true, "is_immutable": true, "value": null, "is_constant": false, "lineno": 144, "annotation": {"ast_type": "Name", "col_offset": 27, "id": "uint8", "lineno": 144, "end_col_offset": 32, "src": "5669:5:0", "end_lineno": 144, "node_id": 109}, "end_col_offset": 34, "src": "5642:34:0", "is_transient": false, "node_id": 100, "end_lineno": 144, "type": {"is_signed": false, "bits": 8, "name": "uint8", "typeclass": "integer"}}, {"target": {"ast_type": "Name", "col_offset": 0, "id": "balanceOf", "lineno": 148, "end_col_offset": 9, "src": "5738:9:0", "end_lineno": 148, "node_id": 112, "type": {"key_type": {"name": "address"}, "value_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "name": "HashMap", "typeclass": "hashmap"}}, "is_reentrant": false, "ast_type": "VariableDecl", "col_offset": 0, "is_public": true, "is_immutable": false, "value": null, "is_constant": false, "lineno": 148, "annotation": {"ast_type": "Subscript", "col_offset": 18, "value": {"ast_type": "Name", "col_offset": 18, "id": "HashMap", "lineno": 148, "end_col_offset": 25, "src": "5756:7:0", "end_lineno": 148, "node_id": 118}, "lineno": 148, "end_col_offset": 43, "src": "5756:25:0", "slice": {"ast_type": "Tuple", "col_offset": 26, "lineno": 148, "end_col_offset": 42, "src": "5764:16:0", "elements": [{"ast_type": "Name", "col_offset": 26, "id": "address", "lineno": 148, "end_col_offset": 33, "src": "5764:7:0", "end_lineno": 148, "node_id": 121}, {"ast_type": "Name", "col_offset": 35, "id": "uint256", "lineno": 148, "end_col_offset": 42, "src": "5773:7:0", "end_lineno": 148, "node_id": 123}], "end_lineno": 148, "node_id": 120}, "end_lineno": 148, "node_id": 117}, "end_col_offset": 44, "src": "5738:44:0", "is_transient": false, "node_id": 111, "end_lineno": 148, "type": {"key_type": {"name": "address"}, "value_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "name": "HashMap", "typeclass": "hashmap"}}, {"target": {"ast_type": "Name", "col_offset": 0, "id": "allowance", "lineno": 156, "end_col_offset": 9, "src": "6015:9:0", "end_lineno": 156, "node_id": 128, "type": {"key_type": {"name": "address"}, "value_type": {"key_type": {"name": "address"}, "value_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "name": "HashMap", "typeclass": "hashmap"}, "name": "HashMap", "typeclass": "hashmap"}}, "is_reentrant": false, "ast_type": "VariableDecl", "col_offset": 0, "is_public": true, "is_immutable": false, "value": null, "is_constant": false, "lineno": 156, "annotation": {"ast_type": "Subscript", "col_offset": 18, "value": {"ast_type": "Name", "col_offset": 18, "id": "HashMap", "lineno": 156, "end_col_offset": 25, "src": "6033:7:0", "end_lineno": 156, "node_id": 134}, "lineno": 156, "end_col_offset": 61, "src": "6033:43:0", "slice": {"ast_type": "Tuple", "col_offset": 26, "lineno": 156, "end_col_offset": 60, "src": "6041:34:0", "elements": [{"ast_type": "Name", "col_offset": 26, "id": "address", "lineno": 156, "end_col_offset": 33, "src": "6041:7:0", "end_lineno": 156, "node_id": 137}, {"ast_type": "Subscript", "col_offset": 35, "value": {"ast_type": "Name", "col_offset": 35, "id": "HashMap", "lineno": 156, "end_col_offset": 42, "src": "6050:7:0", "end_lineno": 156, "node_id": 140}, "lineno": 156, "end_col_offset": 60, "src": "6050:25:0", "slice": {"ast_type": "Tuple", "col_offset": 43, "lineno": 156, "end_col_offset": 59, "src": "6058:16:0", "elements": [{"ast_type": "Name", "col_offset": 43, "id": "address", "lineno": 156, "end_col_offset": 50, "src": "6058:7:0", "end_lineno": 156, "node_id": 143}, {"ast_type": "Name", "col_offset": 52, "id": "uint256", "lineno": 156, "end_col_offset": 59, "src": "6067:7:0", "end_lineno": 156, "node_id": 145}], "end_lineno": 156, "node_id": 142}, "end_lineno": 156, "node_id": 139}], "end_lineno": 156, "node_id": 136}, "end_lineno": 156, "node_id": 133}, "end_col_offset": 62, "src": "6015:62:0", "is_transient": false, "node_id": 127, "end_lineno": 156, "type": {"key_type": {"name": "address"}, "value_type": {"key_type": {"name": "address"}, "value_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "name": "HashMap", "typeclass": "hashmap"}, "name": "HashMap", "typeclass": "hashmap"}}, {"target": {"ast_type": "Name", "col_offset": 0, "id": "totalSupply", "lineno": 160, "end_col_offset": 11, "src": "6130:11:0", "end_lineno": 160, "node_id": 152, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "is_reentrant": false, "ast_type": "VariableDecl", "col_offset": 0, "is_public": true, "is_immutable": false, "value": null, "is_constant": false, "lineno": 160, "annotation": {"ast_type": "Name", "col_offset": 20, "id": "uint256", "lineno": 160, "end_col_offset": 27, "src": "6150:7:0", "end_lineno": 160, "node_id": 157}, "end_col_offset": 28, "src": "6130:28:0", "is_transient": false, "node_id": 151, "end_lineno": 160, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, {"target": {"ast_type": "Name", "col_offset": 0, "id": "is_minter", "lineno": 165, "end_col_offset": 9, "src": "6235:9:0", "end_lineno": 165, "node_id": 160, "type": {"key_type": {"name": "address"}, "value_type": {"name": "bool"}, "name": "HashMap", "typeclass": "hashmap"}}, "is_reentrant": false, "ast_type": "VariableDecl", "col_offset": 0, "is_public": true, "is_immutable": false, "value": null, "is_constant": false, "lineno": 165, "annotation": {"ast_type": "Subscript", "col_offset": 18, "value": {"ast_type": "Name", "col_offset": 18, "id": "HashMap", "lineno": 165, "end_col_offset": 25, "src": "6253:7:0", "end_lineno": 165, "node_id": 166}, "lineno": 165, "end_col_offset": 40, "src": "6253:22:0", "slice": {"ast_type": "Tuple", "col_offset": 26, "lineno": 165, "end_col_offset": 39, "src": "6261:13:0", "elements": [{"ast_type": "Name", "col_offset": 26, "id": "address", "lineno": 165, "end_col_offset": 33, "src": "6261:7:0", "end_lineno": 165, "node_id": 169}, {"ast_type": "Name", "col_offset": 35, "id": "bool", "lineno": 165, "end_col_offset": 39, "src": "6270:4:0", "end_lineno": 165, "node_id": 171}], "end_lineno": 165, "node_id": 168}, "end_lineno": 165, "node_id": 165}, "end_col_offset": 41, "src": "6235:41:0", "is_transient": false, "node_id": 159, "end_lineno": 165, "type": {"key_type": {"name": "address"}, "value_type": {"name": "bool"}, "name": "HashMap", "typeclass": "hashmap"}}, {"target": {"ast_type": "Name", "col_offset": 0, "id": "nonces", "lineno": 170, "end_col_offset": 6, "src": "6345:6:0", "end_lineno": 170, "node_id": 176, "type": {"key_type": {"name": "address"}, "value_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "name": "HashMap", "typeclass": "hashmap"}}, "is_reentrant": false, "ast_type": "VariableDecl", "col_offset": 0, "is_public": true, "is_immutable": false, "value": null, "is_constant": false, "lineno": 170, "annotation": {"ast_type": "Subscript", "col_offset": 15, "value": {"ast_type": "Name", "col_offset": 15, "id": "HashMap", "lineno": 170, "end_col_offset": 22, "src": "6360:7:0", "end_lineno": 170, "node_id": 182}, "lineno": 170, "end_col_offset": 40, "src": "6360:25:0", "slice": {"ast_type": "Tuple", "col_offset": 23, "lineno": 170, "end_col_offset": 39, "src": "6368:16:0", "elements": [{"ast_type": "Name", "col_offset": 23, "id": "address", "lineno": 170, "end_col_offset": 30, "src": "6368:7:0", "end_lineno": 170, "node_id": 185}, {"ast_type": "Name", "col_offset": 32, "id": "uint256", "lineno": 170, "end_col_offset": 39, "src": "6377:7:0", "end_lineno": 170, "node_id": 187}], "end_lineno": 170, "node_id": 184}, "end_lineno": 170, "node_id": 181}, "end_col_offset": 41, "src": "6345:41:0", "is_transient": false, "node_id": 175, "end_lineno": 170, "type": {"key_type": {"name": "address"}, "value_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "name": "HashMap", "typeclass": "hashmap"}}, {"ast_type": "EventDef", "col_offset": 0, "body": [{"target": {"ast_type": "Name", "col_offset": 4, "id": "minter", "lineno": 176, "end_col_offset": 10, "src": "6485:6:0", "end_lineno": 176, "node_id": 193}, "ast_type": "AnnAssign", "col_offset": 4, "value": null, "lineno": 176, "annotation": {"ast_type": "Call", "col_offset": 12, "args": [{"ast_type": "Name", "col_offset": 20, "id": "address", "lineno": 176, "end_col_offset": 27, "src": "6501:7:0", "end_lineno": 176, "node_id": 198}], "lineno": 176, "end_col_offset": 28, "keywords": [], "src": "6493:16:0", "end_lineno": 176, "func": {"ast_type": "Name", "col_offset": 12, "id": "indexed", "lineno": 176, "end_col_offset": 19, "src": "6493:7:0", "end_lineno": 176, "node_id": 196}, "node_id": 195}, "end_col_offset": 28, "src": "6485:24:0", "end_lineno": 176, "node_id": 192}, {"target": {"ast_type": "Name", "col_offset": 4, "id": "status", "lineno": 177, "end_col_offset": 10, "src": "6514:6:0", "end_lineno": 177, "node_id": 201}, "ast_type": "AnnAssign", "col_offset": 4, "value": null, "lineno": 177, "annotation": {"ast_type": "Name", "col_offset": 12, "id": "bool", "lineno": 177, "end_col_offset": 16, "src": "6522:4:0", "end_lineno": 177, "node_id": 203}, "end_col_offset": 16, "src": "6514:12:0", "end_lineno": 177, "node_id": 200}], "lineno": 175, "end_col_offset": 16, "src": "6456:70:0", "end_lineno": 177, "node_id": 191, "doc_string": null, "name": "RoleMinterChanged"}, {"ast_type": "FunctionDef", "col_offset": 0, "returns": null, "body": [{"target": {"ast_type": "Name", "col_offset": 4, "id": "name", "lineno": 205, "end_col_offset": 8, "src": "7666:4:0", "end_lineno": 205, "node_id": 237, "type": {"length": 25, "name": "String", "typeclass": "string"}, "variable_reads": [{"name": "name", "decl_node": {"node_id": 72, "source_id": 0}, "access_path": []}], "variable_writes": [{"name": "name", "decl_node": {"node_id": 72, "source_id": 0}, "access_path": []}]}, "ast_type": "Assign", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 11, "id": "name_", "lineno": 205, "end_col_offset": 16, "src": "7673:5:0", "end_lineno": 205, "node_id": 239, "type": {"length": 25, "name": "String", "typeclass": "string"}, "variable_reads": [{"name": "name_", "decl_node": {"node_id": 207, "source_id": 0}, "access_path": []}]}, "lineno": 205, "end_col_offset": 16, "src": "7666:12:0", "end_lineno": 205, "node_id": 236}, {"target": {"ast_type": "Name", "col_offset": 4, "id": "symbol", "lineno": 206, "end_col_offset": 10, "src": "7683:6:0", "end_lineno": 206, "node_id": 242, "type": {"length": 5, "name": "String", "typeclass": "string"}, "variable_reads": [{"name": "symbol", "decl_node": {"node_id": 86, "source_id": 0}, "access_path": []}], "variable_writes": [{"name": "symbol", "decl_node": {"node_id": 86, "source_id": 0}, "access_path": []}]}, "ast_type": "Assign", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 13, "id": "symbol_", "lineno": 206, "end_col_offset": 20, "src": "7692:7:0", "end_lineno": 206, "node_id": 244, "type": {"length": 5, "name": "String", "typeclass": "string"}, "variable_reads": [{"name": "symbol_", "decl_node": {"node_id": 213, "source_id": 0}, "access_path": []}]}, "lineno": 206, "end_col_offset": 20, "src": "7683:16:0", "end_lineno": 206, "node_id": 241}, {"target": {"ast_type": "Name", "col_offset": 4, "id": "decimals", "lineno": 207, "end_col_offset": 12, "src": "7704:8:0", "end_lineno": 207, "node_id": 247, "type": {"is_signed": false, "bits": 8, "name": "uint8", "typeclass": "integer"}, "variable_reads": [{"name": "decimals", "decl_node": {"node_id": 100, "source_id": 0}, "access_path": []}], "variable_writes": [{"name": "decimals", "decl_node": {"node_id": 100, "source_id": 0}, "access_path": []}]}, "ast_type": "Assign", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 15, "id": "decimals_", "lineno": 207, "end_col_offset": 24, "src": "7715:9:0", "end_lineno": 207, "node_id": 249, "type": {"is_signed": false, "bits": 8, "name": "uint8", "typeclass": "integer"}, "variable_reads": [{"name": "decimals_", "decl_node": {"node_id": 219, "source_id": 0}, "access_path": []}]}, "lineno": 207, "end_col_offset": 24, "src": "7704:20:0", "end_lineno": 207, "node_id": 246}, {"target": {"ast_type": "Subscript", "col_offset": 4, "value": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 209, "end_col_offset": 8, "src": "7730:4:0", "end_lineno": 209, "node_id": 254, "type": {"name": "self"}}, "lineno": 209, "end_col_offset": 18, "src": "7730:14:0", "end_lineno": 209, "node_id": 253, "attr": "is_minter", "type": {"key_type": {"name": "address"}, "value_type": {"name": "bool"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "is_minter", "decl_node": {"node_id": 159, "source_id": 0}, "access_path": []}]}, "lineno": 209, "end_col_offset": 30, "src": "7730:26:0", "slice": {"ast_type": "Attribute", "col_offset": 19, "value": {"ast_type": "Name", "col_offset": 19, "id": "msg", "lineno": 209, "end_col_offset": 22, "src": "7745:3:0", "end_lineno": 209, "node_id": 258, "type": {"name": "msg"}}, "lineno": 209, "end_col_offset": 29, "src": "7745:10:0", "end_lineno": 209, "node_id": 257, "attr": "sender", "type": {"name": "address"}}, "end_lineno": 209, "node_id": 252, "type": {"name": "bool"}, "variable_reads": [{"name": "is_minter", "decl_node": {"node_id": 159, "source_id": 0}, "access_path": ["$subscript_access"]}], "variable_writes": [{"name": "is_minter", "decl_node": {"node_id": 159, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "ast_type": "Assign", "col_offset": 4, "value": {"ast_type": "NameConstant", "col_offset": 33, "value": true, "lineno": 209, "end_col_offset": 37, "src": "7759:4:0", "end_lineno": 209, "node_id": 262, "type": {"name": "bool"}}, "lineno": 209, "end_col_offset": 37, "src": "7730:33:0", "end_lineno": 209, "node_id": 251}, {"ast_type": "Log", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 8, "args": [], "lineno": 210, "end_col_offset": 57, "keywords": [{"ast_type": "keyword", "col_offset": 26, "value": {"ast_type": "Attribute", "col_offset": 33, "value": {"ast_type": "Name", "col_offset": 33, "id": "msg", "lineno": 210, "end_col_offset": 36, "src": "7797:3:0", "end_lineno": 210, "node_id": 270, "type": {"name": "msg"}}, "lineno": 210, "end_col_offset": 43, "src": "7797:10:0", "end_lineno": 210, "node_id": 269, "attr": "sender", "type": {"name": "address"}}, "lineno": 210, "end_col_offset": 43, "src": "7790:17:0", "end_lineno": 210, "arg": "minter", "node_id": 268}, {"ast_type": "keyword", "col_offset": 45, "value": {"ast_type": "NameConstant", "col_offset": 52, "value": true, "lineno": 210, "end_col_offset": 56, "src": "7816:4:0", "end_lineno": 210, "node_id": 274, "type": {"name": "bool"}}, "lineno": 210, "end_col_offset": 56, "src": "7809:11:0", "end_lineno": 210, "arg": "status", "node_id": 273}], "src": "7772:49:0", "end_lineno": 210, "func": {"ast_type": "Name", "col_offset": 8, "id": "RoleMinterChanged", "lineno": 210, "end_col_offset": 25, "src": "7772:17:0", "end_lineno": 210, "node_id": 266, "type": {"type_t": {"name": "RoleMinterChanged", "type_decl_node": {"node_id": 191, "source_id": 0}, "typeclass": "event"}}}, "node_id": 265, "type": {"name": "(void)"}}, "lineno": 210, "end_col_offset": 57, "src": "7768:53:0", "end_lineno": 210, "node_id": 264, "type": {"name": "RoleMinterChanged", "type_decl_node": {"node_id": 191, "source_id": 0}, "typeclass": "event"}}, {"ast_type": "Expr", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 4, "args": [{"ast_type": "Name", "col_offset": 37, "id": "name_eip712_", "lineno": 212, "end_col_offset": 49, "src": "7860:12:0", "end_lineno": 212, "node_id": 281, "type": {"length": 50, "name": "String", "typeclass": "string"}, "variable_reads": [{"name": "name_eip712_", "decl_node": {"node_id": 222, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 51, "id": "version_eip712_", "lineno": 212, "end_col_offset": 66, "src": "7874:15:0", "end_lineno": 212, "node_id": 283, "type": {"length": 20, "name": "String", "typeclass": "string"}, "variable_reads": [{"name": "version_eip712_", "decl_node": {"node_id": 228, "source_id": 0}, "access_path": []}]}], "lineno": 212, "end_col_offset": 67, "keywords": [], "src": "7827:63:0", "end_lineno": 212, "func": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "eip712_domain_separator", "lineno": 212, "end_col_offset": 27, "src": "7827:23:0", "end_lineno": 212, "node_id": 278, "type": {"name": "src/snekmate/utils/eip712_domain_separator.vy", "type_decl_node": {"node_id": 0, "source_id": 5}, "typeclass": "module"}}, "lineno": 212, "end_col_offset": 36, "src": "7827:32:0", "end_lineno": 212, "node_id": 277, "attr": "__init__", "type": {"name": "__init__", "type_decl_node": {"node_id": 86, "source_id": 5}, "typeclass": "contract_function"}, "variable_reads": [{"name": "_NAME", "decl_node": {"node_id": 48, "source_id": 5}, "access_path": []}, {"name": "_VERSION", "decl_node": {"node_id": 67, "source_id": 5}, "access_path": []}, {"name": "_HASHED_NAME", "decl_node": {"node_id": 59, "source_id": 5}, "access_path": []}, {"name": "_HASHED_VERSION", "decl_node": {"node_id": 78, "source_id": 5}, "access_path": []}, {"name": "_CACHED_DOMAIN_SEPARATOR", "decl_node": {"node_id": 24, "source_id": 5}, "access_path": []}, {"name": "_CACHED_CHAIN_ID", "decl_node": {"node_id": 32, "source_id": 5}, "access_path": []}, {"name": "_CACHED_SELF", "decl_node": {"node_id": 40, "source_id": 5}, "access_path": []}], "variable_writes": [{"name": "_NAME", "decl_node": {"node_id": 48, "source_id": 5}, "access_path": []}, {"name": "_VERSION", "decl_node": {"node_id": 67, "source_id": 5}, "access_path": []}, {"name": "_HASHED_NAME", "decl_node": {"node_id": 59, "source_id": 5}, "access_path": []}, {"name": "_HASHED_VERSION", "decl_node": {"node_id": 78, "source_id": 5}, "access_path": []}, {"name": "_CACHED_DOMAIN_SEPARATOR", "decl_node": {"node_id": 24, "source_id": 5}, "access_path": []}, {"name": "_CACHED_CHAIN_ID", "decl_node": {"node_id": 32, "source_id": 5}, "access_path": []}, {"name": "_CACHED_SELF", "decl_node": {"node_id": 40, "source_id": 5}, "access_path": []}]}, "node_id": 276, "type": {"name": "(void)"}}, "lineno": 212, "end_col_offset": 67, "src": "7827:63:0", "end_lineno": 212, "node_id": 275}], "args": {"ast_type": "arguments", "col_offset": 0, "defaults": [], "args": [{"ast_type": "arg", "col_offset": 4, "lineno": 183, "annotation": {"ast_type": "Subscript", "col_offset": 11, "value": {"ast_type": "Name", "col_offset": 11, "id": "String", "lineno": 183, "end_col_offset": 17, "src": "6571:6:0", "end_lineno": 183, "node_id": 209}, "lineno": 183, "end_col_offset": 21, "src": "6571:10:0", "slice": {"ast_type": "Int", "col_offset": 18, "value": 25, "lineno": 183, "end_col_offset": 20, "src": "6578:2:0", "end_lineno": 183, "node_id": 211}, "end_lineno": 183, "node_id": 208}, "end_col_offset": 21, "src": "6564:17:0", "end_lineno": 183, "arg": "name_", "node_id": 207}, {"ast_type": "arg", "col_offset": 23, "lineno": 183, "annotation": {"ast_type": "Subscript", "col_offset": 32, "value": {"ast_type": "Name", "col_offset": 32, "id": "String", "lineno": 183, "end_col_offset": 38, "src": "6592:6:0", "end_lineno": 183, "node_id": 215}, "lineno": 183, "end_col_offset": 41, "src": "6592:9:0", "slice": {"ast_type": "Int", "col_offset": 39, "value": 5, "lineno": 183, "end_col_offset": 40, "src": "6599:1:0", "end_lineno": 183, "node_id": 217}, "end_lineno": 183, "node_id": 214}, "end_col_offset": 41, "src": "6583:18:0", "end_lineno": 183, "arg": "symbol_", "node_id": 213}, {"ast_type": "arg", "col_offset": 43, "lineno": 183, "annotation": {"ast_type": "Name", "col_offset": 54, "id": "uint8", "lineno": 183, "end_col_offset": 59, "src": "6614:5:0", "end_lineno": 183, "node_id": 220}, "end_col_offset": 59, "src": "6603:16:0", "end_lineno": 183, "arg": "decimals_", "node_id": 219}, {"ast_type": "arg", "col_offset": 61, "lineno": 183, "annotation": {"ast_type": "Subscript", "col_offset": 75, "value": {"ast_type": "Name", "col_offset": 75, "id": "String", "lineno": 183, "end_col_offset": 81, "src": "6635:6:0", "end_lineno": 183, "node_id": 224}, "lineno": 183, "end_col_offset": 85, "src": "6635:10:0", "slice": {"ast_type": "Int", "col_offset": 82, "value": 50, "lineno": 183, "end_col_offset": 84, "src": "6642:2:0", "end_lineno": 183, "node_id": 226}, "end_lineno": 183, "node_id": 223}, "end_col_offset": 85, "src": "6621:24:0", "end_lineno": 183, "arg": "name_eip712_", "node_id": 222}, {"ast_type": "arg", "col_offset": 87, "lineno": 183, "annotation": {"ast_type": "Subscript", "col_offset": 104, "value": {"ast_type": "Name", "col_offset": 104, "id": "String", "lineno": 183, "end_col_offset": 110, "src": "6664:6:0", "end_lineno": 183, "node_id": 230}, "lineno": 183, "end_col_offset": 114, "src": "6664:10:0", "slice": {"ast_type": "Int", "col_offset": 111, "value": 20, "lineno": 183, "end_col_offset": 113, "src": "6671:2:0", "end_lineno": 183, "node_id": 232}, "end_lineno": 183, "node_id": 229}, "end_col_offset": 114, "src": "6647:27:0", "end_lineno": 183, "arg": "version_eip712_", "node_id": 228}], "lineno": 182, "end_col_offset": 67, "default": null, "src": "6546:1344:0", "end_lineno": 212, "node_id": 206}, "lineno": 182, "end_col_offset": 67, "pos": null, "src": "6546:1344:0", "decorator_list": [{"ast_type": "Name", "col_offset": 1, "id": "deploy", "lineno": 180, "end_col_offset": 7, "src": "6530:6:0", "end_lineno": 180, "node_id": 285}, {"ast_type": "Name", "col_offset": 1, "id": "payable", "lineno": 181, "end_col_offset": 8, "src": "6538:7:0", "end_lineno": 181, "node_id": 287}], "end_lineno": 212, "node_id": 205, "doc_string": {"ast_type": "DocStr", "col_offset": 4, "value": "\n @dev To omit the opcodes for checking the `msg.value`\n in the creation-time EVM bytecode, the constructor\n is declared as `payable`.\n @notice At initialisation time, the `owner` role will be\n assigned to the `msg.sender` since we `uses` the\n `ownable` module, which implements the aforementioned\n logic at contract creation time.\n @param name_ The maximum 25-character user-readable\n string name of the token.\n @param symbol_ The maximum 5-character user-readable\n string symbol of the token.\n @param decimals_ The 1-byte decimal places of the token.\n @param name_eip712_ The maximum 50-character user-readable\n string name of the signing domain, i.e. the name\n of the dApp or protocol.\n @param version_eip712_ The maximum 20-character current\n main version of the signing domain. Signatures\n from different versions are not compatible.\n ", "lineno": 185, "end_col_offset": 7, "src": "6682:979:0", "end_lineno": 204, "node_id": 289}, "name": "__init__"}, {"ast_type": "FunctionDef", "col_offset": 0, "returns": {"ast_type": "Name", "col_offset": 46, "id": "bool", "lineno": 216, "end_col_offset": 50, "src": "7949:4:0", "end_lineno": 216, "node_id": 318}, "body": [{"ast_type": "Expr", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 4, "args": [{"ast_type": "Attribute", "col_offset": 19, "value": {"ast_type": "Name", "col_offset": 19, "id": "msg", "lineno": 229, "end_col_offset": 22, "src": "8483:3:0", "end_lineno": 229, "node_id": 307, "type": {"name": "msg"}}, "lineno": 229, "end_col_offset": 29, "src": "8483:10:0", "end_lineno": 229, "node_id": 306, "attr": "sender", "type": {"name": "address"}}, {"ast_type": "Name", "col_offset": 31, "id": "to", "lineno": 229, "end_col_offset": 33, "src": "8495:2:0", "end_lineno": 229, "node_id": 310, "type": {"name": "address"}, "variable_reads": [{"name": "to", "decl_node": {"node_id": 292, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 35, "id": "amount", "lineno": 229, "end_col_offset": 41, "src": "8499:6:0", "end_lineno": 229, "node_id": 312, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 295, "source_id": 0}, "access_path": []}]}], "lineno": 229, "end_col_offset": 42, "keywords": [], "src": "8468:38:0", "end_lineno": 229, "func": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 229, "end_col_offset": 8, "src": "8468:4:0", "end_lineno": 229, "node_id": 303, "type": {"name": "self"}}, "lineno": 229, "end_col_offset": 18, "src": "8468:14:0", "end_lineno": 229, "node_id": 302, "attr": "_transfer", "type": {"name": "_transfer", "type_decl_node": {"node_id": 852, "source_id": 0}, "typeclass": "contract_function"}, "variable_reads": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": []}, {"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": ["$subscript_access"]}], "variable_writes": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "node_id": 301, "type": {"name": "(void)"}}, "lineno": 229, "end_col_offset": 42, "src": "8468:38:0", "end_lineno": 229, "node_id": 300}, {"ast_type": "Return", "col_offset": 4, "value": {"ast_type": "NameConstant", "col_offset": 11, "value": true, "lineno": 230, "end_col_offset": 15, "src": "8518:4:0", "end_lineno": 230, "node_id": 315, "type": {"name": "bool"}}, "lineno": 230, "end_col_offset": 15, "src": "8511:11:0", "end_lineno": 230, "node_id": 314}], "args": {"ast_type": "arguments", "col_offset": 0, "defaults": [], "args": [{"ast_type": "arg", "col_offset": 13, "lineno": 216, "annotation": {"ast_type": "Name", "col_offset": 17, "id": "address", "lineno": 216, "end_col_offset": 24, "src": "7920:7:0", "end_lineno": 216, "node_id": 293}, "end_col_offset": 24, "src": "7916:11:0", "end_lineno": 216, "arg": "to", "node_id": 292}, {"ast_type": "arg", "col_offset": 26, "lineno": 216, "annotation": {"ast_type": "Name", "col_offset": 34, "id": "uint256", "lineno": 216, "end_col_offset": 41, "src": "7937:7:0", "end_lineno": 216, "node_id": 296}, "end_col_offset": 41, "src": "7929:15:0", "end_lineno": 216, "arg": "amount", "node_id": 295}], "lineno": 216, "end_col_offset": 15, "default": null, "src": "7903:619:0", "end_lineno": 230, "node_id": 291}, "lineno": 216, "end_col_offset": 15, "pos": null, "src": "7903:619:0", "decorator_list": [{"ast_type": "Name", "col_offset": 1, "id": "external", "lineno": 215, "end_col_offset": 9, "src": "7894:8:0", "end_lineno": 215, "node_id": 316}], "end_lineno": 230, "node_id": 290, "doc_string": {"ast_type": "DocStr", "col_offset": 4, "value": "\n @dev Moves `amount` tokens from the caller's\n account to `to`.\n @notice Note that `to` cannot be the zero address.\n Also, the caller must have a balance of at\n least `amount`.\n @param to The 20-byte receiver address.\n @param amount The 32-byte token amount to be transferred.\n @return bool The verification whether the transfer succeeded\n or failed. Note that the function reverts instead\n of returning `False` on a failure.\n ", "lineno": 217, "end_col_offset": 7, "src": "7959:504:0", "end_lineno": 228, "node_id": 320}, "name": "transfer"}, {"ast_type": "FunctionDef", "col_offset": 0, "returns": {"ast_type": "Name", "col_offset": 50, "id": "bool", "lineno": 234, "end_col_offset": 54, "src": "8585:4:0", "end_lineno": 234, "node_id": 349}, "body": [{"ast_type": "Expr", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 4, "args": [{"ast_type": "Attribute", "col_offset": 18, "value": {"ast_type": "Name", "col_offset": 18, "id": "msg", "lineno": 259, "end_col_offset": 21, "src": "9789:3:0", "end_lineno": 259, "node_id": 338, "type": {"name": "msg"}}, "lineno": 259, "end_col_offset": 28, "src": "9789:10:0", "end_lineno": 259, "node_id": 337, "attr": "sender", "type": {"name": "address"}}, {"ast_type": "Name", "col_offset": 30, "id": "spender", "lineno": 259, "end_col_offset": 37, "src": "9801:7:0", "end_lineno": 259, "node_id": 341, "type": {"name": "address"}, "variable_reads": [{"name": "spender", "decl_node": {"node_id": 323, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 39, "id": "amount", "lineno": 259, "end_col_offset": 45, "src": "9810:6:0", "end_lineno": 259, "node_id": 343, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 326, "source_id": 0}, "access_path": []}]}], "lineno": 259, "end_col_offset": 46, "keywords": [], "src": "9775:42:0", "end_lineno": 259, "func": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 259, "end_col_offset": 8, "src": "9775:4:0", "end_lineno": 259, "node_id": 334, "type": {"name": "self"}}, "lineno": 259, "end_col_offset": 17, "src": "9775:13:0", "end_lineno": 259, "node_id": 333, "attr": "_approve", "type": {"name": "_approve", "type_decl_node": {"node_id": 1216, "source_id": 0}, "typeclass": "contract_function"}, "variable_reads": [{"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": []}, {"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": ["$subscript_access"]}, {"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}], "variable_writes": [{"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}]}, "node_id": 332, "type": {"name": "(void)"}}, "lineno": 259, "end_col_offset": 46, "src": "9775:42:0", "end_lineno": 259, "node_id": 331}, {"ast_type": "Return", "col_offset": 4, "value": {"ast_type": "NameConstant", "col_offset": 11, "value": true, "lineno": 260, "end_col_offset": 15, "src": "9829:4:0", "end_lineno": 260, "node_id": 346, "type": {"name": "bool"}}, "lineno": 260, "end_col_offset": 15, "src": "9822:11:0", "end_lineno": 260, "node_id": 345}], "args": {"ast_type": "arguments", "col_offset": 0, "defaults": [], "args": [{"ast_type": "arg", "col_offset": 12, "lineno": 234, "annotation": {"ast_type": "Name", "col_offset": 21, "id": "address", "lineno": 234, "end_col_offset": 28, "src": "8556:7:0", "end_lineno": 234, "node_id": 324}, "end_col_offset": 28, "src": "8547:16:0", "end_lineno": 234, "arg": "spender", "node_id": 323}, {"ast_type": "arg", "col_offset": 30, "lineno": 234, "annotation": {"ast_type": "Name", "col_offset": 38, "id": "uint256", "lineno": 234, "end_col_offset": 45, "src": "8573:7:0", "end_lineno": 234, "node_id": 327}, "end_col_offset": 45, "src": "8565:15:0", "end_lineno": 234, "arg": "amount", "node_id": 326}], "lineno": 234, "end_col_offset": 15, "default": null, "src": "8535:1298:0", "end_lineno": 260, "node_id": 322}, "lineno": 234, "end_col_offset": 15, "pos": null, "src": "8535:1298:0", "decorator_list": [{"ast_type": "Name", "col_offset": 1, "id": "external", "lineno": 233, "end_col_offset": 9, "src": "8526:8:0", "end_lineno": 233, "node_id": 347}], "end_lineno": 260, "node_id": 321, "doc_string": {"ast_type": "DocStr", "col_offset": 4, "value": "\n @dev Sets `amount` as the allowance of `spender`\n over the caller's tokens.\n @notice WARNING: Note that if `amount` is the maximum\n `uint256`, the allowance is not updated on\n `transferFrom`. This is semantically equivalent\n to an infinite approval. Also, `spender` cannot\n be the zero address.\n\n IMPORTANT: Beware that changing an allowance\n with this method brings the risk that someone\n may use both the old and the new allowance by\n unfortunate transaction ordering. One possible\n solution to mitigate this race condition is to\n first reduce the spender's allowance to `0` and\n set the desired amount afterwards:\n https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729.\n @param spender The 20-byte spender address.\n @param amount The 32-byte token amount that is\n allowed to be spent by the `spender`.\n @return bool The verification whether the approval operation\n succeeded or failed. Note that the function reverts\n instead of returning `False` on a failure.\n ", "lineno": 235, "end_col_offset": 7, "src": "8595:1175:0", "end_lineno": 258, "node_id": 351}, "name": "approve"}, {"ast_type": "FunctionDef", "col_offset": 0, "returns": {"ast_type": "Name", "col_offset": 66, "id": "bool", "lineno": 264, "end_col_offset": 70, "src": "9912:4:0", "end_lineno": 264, "node_id": 395}, "body": [{"ast_type": "Expr", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 4, "args": [{"ast_type": "Name", "col_offset": 26, "id": "owner", "lineno": 286, "end_col_offset": 31, "src": "10850:5:0", "end_lineno": 286, "node_id": 371, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 354, "source_id": 0}, "access_path": []}]}, {"ast_type": "Attribute", "col_offset": 33, "value": {"ast_type": "Name", "col_offset": 33, "id": "msg", "lineno": 286, "end_col_offset": 36, "src": "10857:3:0", "end_lineno": 286, "node_id": 374, "type": {"name": "msg"}}, "lineno": 286, "end_col_offset": 43, "src": "10857:10:0", "end_lineno": 286, "node_id": 373, "attr": "sender", "type": {"name": "address"}}, {"ast_type": "Name", "col_offset": 45, "id": "amount", "lineno": 286, "end_col_offset": 51, "src": "10869:6:0", "end_lineno": 286, "node_id": 377, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 360, "source_id": 0}, "access_path": []}]}], "lineno": 286, "end_col_offset": 52, "keywords": [], "src": "10828:48:0", "end_lineno": 286, "func": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 286, "end_col_offset": 8, "src": "10828:4:0", "end_lineno": 286, "node_id": 368, "type": {"name": "self"}}, "lineno": 286, "end_col_offset": 25, "src": "10828:21:0", "end_lineno": 286, "node_id": 367, "attr": "_spend_allowance", "type": {"name": "_spend_allowance", "type_decl_node": {"node_id": 1285, "source_id": 0}, "typeclass": "contract_function"}, "variable_reads": [{"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": []}, {"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": ["$subscript_access"]}, {"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}], "variable_writes": [{"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}]}, "node_id": 366, "type": {"name": "(void)"}}, "lineno": 286, "end_col_offset": 52, "src": "10828:48:0", "end_lineno": 286, "node_id": 365}, {"ast_type": "Expr", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 4, "args": [{"ast_type": "Name", "col_offset": 19, "id": "owner", "lineno": 287, "end_col_offset": 24, "src": "10896:5:0", "end_lineno": 287, "node_id": 385, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 354, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 26, "id": "to", "lineno": 287, "end_col_offset": 28, "src": "10903:2:0", "end_lineno": 287, "node_id": 387, "type": {"name": "address"}, "variable_reads": [{"name": "to", "decl_node": {"node_id": 357, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 30, "id": "amount", "lineno": 287, "end_col_offset": 36, "src": "10907:6:0", "end_lineno": 287, "node_id": 389, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 360, "source_id": 0}, "access_path": []}]}], "lineno": 287, "end_col_offset": 37, "keywords": [], "src": "10881:33:0", "end_lineno": 287, "func": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 287, "end_col_offset": 8, "src": "10881:4:0", "end_lineno": 287, "node_id": 382, "type": {"name": "self"}}, "lineno": 287, "end_col_offset": 18, "src": "10881:14:0", "end_lineno": 287, "node_id": 381, "attr": "_transfer", "type": {"name": "_transfer", "type_decl_node": {"node_id": 852, "source_id": 0}, "typeclass": "contract_function"}, "variable_reads": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": []}, {"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": ["$subscript_access"]}], "variable_writes": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "node_id": 380, "type": {"name": "(void)"}}, "lineno": 287, "end_col_offset": 37, "src": "10881:33:0", "end_lineno": 287, "node_id": 379}, {"ast_type": "Return", "col_offset": 4, "value": {"ast_type": "NameConstant", "col_offset": 11, "value": true, "lineno": 288, "end_col_offset": 15, "src": "10926:4:0", "end_lineno": 288, "node_id": 392, "type": {"name": "bool"}}, "lineno": 288, "end_col_offset": 15, "src": "10919:11:0", "end_lineno": 288, "node_id": 391}], "args": {"ast_type": "arguments", "col_offset": 0, "defaults": [], "args": [{"ast_type": "arg", "col_offset": 17, "lineno": 264, "annotation": {"ast_type": "Name", "col_offset": 24, "id": "address", "lineno": 264, "end_col_offset": 31, "src": "9870:7:0", "end_lineno": 264, "node_id": 355}, "end_col_offset": 31, "src": "9863:14:0", "end_lineno": 264, "arg": "owner", "node_id": 354}, {"ast_type": "arg", "col_offset": 33, "lineno": 264, "annotation": {"ast_type": "Name", "col_offset": 37, "id": "address", "lineno": 264, "end_col_offset": 44, "src": "9883:7:0", "end_lineno": 264, "node_id": 358}, "end_col_offset": 44, "src": "9879:11:0", "end_lineno": 264, "arg": "to", "node_id": 357}, {"ast_type": "arg", "col_offset": 46, "lineno": 264, "annotation": {"ast_type": "Name", "col_offset": 54, "id": "uint256", "lineno": 264, "end_col_offset": 61, "src": "9900:7:0", "end_lineno": 264, "node_id": 361}, "end_col_offset": 61, "src": "9892:15:0", "end_lineno": 264, "arg": "amount", "node_id": 360}], "lineno": 264, "end_col_offset": 15, "default": null, "src": "9846:1084:0", "end_lineno": 288, "node_id": 353}, "lineno": 264, "end_col_offset": 15, "pos": null, "src": "9846:1084:0", "decorator_list": [{"ast_type": "Name", "col_offset": 1, "id": "external", "lineno": 263, "end_col_offset": 9, "src": "9837:8:0", "end_lineno": 263, "node_id": 393}], "end_lineno": 288, "node_id": 352, "doc_string": {"ast_type": "DocStr", "col_offset": 4, "value": "\n @dev Moves `amount` tokens from `owner`\n to `to` using the allowance mechanism.\n The `amount` is then deducted from the\n caller's allowance.\n @notice Note that `owner` and `to` cannot\n be the zero address. Also, `owner`\n must have a balance of at least `amount`.\n Eventually, the caller must have allowance\n for `owner`'s tokens of at least `amount`.\n\n WARNING: The function does not update the\n allowance if the current allowance is the\n maximum `uint256`.\n @param owner The 20-byte owner address.\n @param to The 20-byte receiver address.\n @param amount The 32-byte token amount to be transferred.\n @return bool The verification whether the transfer succeeded\n or failed. Note that the function reverts instead\n of returning `False` on a failure.\n ", "lineno": 265, "end_col_offset": 7, "src": "9922:901:0", "end_lineno": 285, "node_id": 397}, "name": "transferFrom"}, {"ast_type": "FunctionDef", "col_offset": 0, "returns": null, "body": [{"ast_type": "Expr", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 4, "args": [{"ast_type": "Attribute", "col_offset": 15, "value": {"ast_type": "Name", "col_offset": 15, "id": "msg", "lineno": 297, "end_col_offset": 18, "src": "11112:3:0", "end_lineno": 297, "node_id": 412, "type": {"name": "msg"}}, "lineno": 297, "end_col_offset": 25, "src": "11112:10:0", "end_lineno": 297, "node_id": 411, "attr": "sender", "type": {"name": "address"}}, {"ast_type": "Name", "col_offset": 27, "id": "amount", "lineno": 297, "end_col_offset": 33, "src": "11124:6:0", "end_lineno": 297, "node_id": 415, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 400, "source_id": 0}, "access_path": []}]}], "lineno": 297, "end_col_offset": 34, "keywords": [], "src": "11101:30:0", "end_lineno": 297, "func": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 297, "end_col_offset": 8, "src": "11101:4:0", "end_lineno": 297, "node_id": 408, "type": {"name": "self"}}, "lineno": 297, "end_col_offset": 14, "src": "11101:10:0", "end_lineno": 297, "node_id": 407, "attr": "_burn", "type": {"name": "_burn", "type_decl_node": {"node_id": 1092, "source_id": 0}, "typeclass": "contract_function"}, "variable_reads": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": []}, {"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": ["$subscript_access"]}, {"name": "totalSupply", "decl_node": {"node_id": 151, "source_id": 0}, "access_path": []}], "variable_writes": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": ["$subscript_access"]}, {"name": "totalSupply", "decl_node": {"node_id": 151, "source_id": 0}, "access_path": []}]}, "node_id": 406, "type": {"name": "(void)"}}, "lineno": 297, "end_col_offset": 34, "src": "11101:30:0", "end_lineno": 297, "node_id": 405}], "args": {"ast_type": "arguments", "col_offset": 0, "defaults": [], "args": [{"ast_type": "arg", "col_offset": 9, "lineno": 292, "annotation": {"ast_type": "Name", "col_offset": 17, "id": "uint256", "lineno": 292, "end_col_offset": 24, "src": "10960:7:0", "end_lineno": 292, "node_id": 401}, "end_col_offset": 24, "src": "10952:15:0", "end_lineno": 292, "arg": "amount", "node_id": 400}], "lineno": 292, "end_col_offset": 34, "default": null, "src": "10943:188:0", "end_lineno": 297, "node_id": 399}, "lineno": 292, "end_col_offset": 34, "pos": null, "src": "10943:188:0", "decorator_list": [{"ast_type": "Name", "col_offset": 1, "id": "external", "lineno": 291, "end_col_offset": 9, "src": "10934:8:0", "end_lineno": 291, "node_id": 417}], "end_lineno": 297, "node_id": 398, "doc_string": {"ast_type": "DocStr", "col_offset": 4, "value": "\n @dev Destroys `amount` tokens from the caller.\n @param amount The 32-byte token amount to be destroyed.\n ", "lineno": 293, "end_col_offset": 7, "src": "10974:122:0", "end_lineno": 296, "node_id": 419}, "name": "burn"}, {"ast_type": "FunctionDef", "col_offset": 0, "returns": null, "body": [{"ast_type": "Expr", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 4, "args": [{"ast_type": "Name", "col_offset": 26, "id": "owner", "lineno": 312, "end_col_offset": 31, "src": "11611:5:0", "end_lineno": 312, "node_id": 436, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 422, "source_id": 0}, "access_path": []}]}, {"ast_type": "Attribute", "col_offset": 33, "value": {"ast_type": "Name", "col_offset": 33, "id": "msg", "lineno": 312, "end_col_offset": 36, "src": "11618:3:0", "end_lineno": 312, "node_id": 439, "type": {"name": "msg"}}, "lineno": 312, "end_col_offset": 43, "src": "11618:10:0", "end_lineno": 312, "node_id": 438, "attr": "sender", "type": {"name": "address"}}, {"ast_type": "Name", "col_offset": 45, "id": "amount", "lineno": 312, "end_col_offset": 51, "src": "11630:6:0", "end_lineno": 312, "node_id": 442, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 425, "source_id": 0}, "access_path": []}]}], "lineno": 312, "end_col_offset": 52, "keywords": [], "src": "11589:48:0", "end_lineno": 312, "func": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 312, "end_col_offset": 8, "src": "11589:4:0", "end_lineno": 312, "node_id": 433, "type": {"name": "self"}}, "lineno": 312, "end_col_offset": 25, "src": "11589:21:0", "end_lineno": 312, "node_id": 432, "attr": "_spend_allowance", "type": {"name": "_spend_allowance", "type_decl_node": {"node_id": 1285, "source_id": 0}, "typeclass": "contract_function"}, "variable_reads": [{"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": []}, {"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": ["$subscript_access"]}, {"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}], "variable_writes": [{"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}]}, "node_id": 431, "type": {"name": "(void)"}}, "lineno": 312, "end_col_offset": 52, "src": "11589:48:0", "end_lineno": 312, "node_id": 430}, {"ast_type": "Expr", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 4, "args": [{"ast_type": "Name", "col_offset": 15, "id": "owner", "lineno": 313, "end_col_offset": 20, "src": "11653:5:0", "end_lineno": 313, "node_id": 450, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 422, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 22, "id": "amount", "lineno": 313, "end_col_offset": 28, "src": "11660:6:0", "end_lineno": 313, "node_id": 452, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 425, "source_id": 0}, "access_path": []}]}], "lineno": 313, "end_col_offset": 29, "keywords": [], "src": "11642:25:0", "end_lineno": 313, "func": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 313, "end_col_offset": 8, "src": "11642:4:0", "end_lineno": 313, "node_id": 447, "type": {"name": "self"}}, "lineno": 313, "end_col_offset": 14, "src": "11642:10:0", "end_lineno": 313, "node_id": 446, "attr": "_burn", "type": {"name": "_burn", "type_decl_node": {"node_id": 1092, "source_id": 0}, "typeclass": "contract_function"}, "variable_reads": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": []}, {"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": ["$subscript_access"]}, {"name": "totalSupply", "decl_node": {"node_id": 151, "source_id": 0}, "access_path": []}], "variable_writes": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": ["$subscript_access"]}, {"name": "totalSupply", "decl_node": {"node_id": 151, "source_id": 0}, "access_path": []}]}, "node_id": 445, "type": {"name": "(void)"}}, "lineno": 313, "end_col_offset": 29, "src": "11642:25:0", "end_lineno": 313, "node_id": 444}], "args": {"ast_type": "arguments", "col_offset": 0, "defaults": [], "args": [{"ast_type": "arg", "col_offset": 14, "lineno": 301, "annotation": {"ast_type": "Name", "col_offset": 21, "id": "address", "lineno": 301, "end_col_offset": 28, "src": "11165:7:0", "end_lineno": 301, "node_id": 423}, "end_col_offset": 28, "src": "11158:14:0", "end_lineno": 301, "arg": "owner", "node_id": 422}, {"ast_type": "arg", "col_offset": 30, "lineno": 301, "annotation": {"ast_type": "Name", "col_offset": 38, "id": "uint256", "lineno": 301, "end_col_offset": 45, "src": "11182:7:0", "end_lineno": 301, "node_id": 426}, "end_col_offset": 45, "src": "11174:15:0", "end_lineno": 301, "arg": "amount", "node_id": 425}], "lineno": 301, "end_col_offset": 29, "default": null, "src": "11144:523:0", "end_lineno": 313, "node_id": 421}, "lineno": 301, "end_col_offset": 29, "pos": null, "src": "11144:523:0", "decorator_list": [{"ast_type": "Name", "col_offset": 1, "id": "external", "lineno": 300, "end_col_offset": 9, "src": "11135:8:0", "end_lineno": 300, "node_id": 454}], "end_lineno": 313, "node_id": 420, "doc_string": {"ast_type": "DocStr", "col_offset": 4, "value": "\n @dev Destroys `amount` tokens from `owner`,\n deducting from the caller's allowance.\n @notice Note that `owner` cannot be the\n zero address. Also, the caller must\n have an allowance for `owner`'s tokens\n of at least `amount`.\n @param owner The 20-byte owner address.\n @param amount The 32-byte token amount to be destroyed.\n ", "lineno": 302, "end_col_offset": 7, "src": "11196:388:0", "end_lineno": 311, "node_id": 456}, "name": "burn_from"}, {"ast_type": "FunctionDef", "col_offset": 0, "returns": null, "body": [{"msg": {"ast_type": "Str", "col_offset": 39, "value": "erc20: access is denied", "lineno": 325, "end_col_offset": 64, "src": "12062:25:0", "end_lineno": 325, "node_id": 478, "type": {"length": 23, "name": "String", "typeclass": "string"}}, "ast_type": "Assert", "col_offset": 4, "lineno": 325, "test": {"ast_type": "Subscript", "col_offset": 11, "value": {"ast_type": "Attribute", "col_offset": 11, "value": {"ast_type": "Name", "col_offset": 11, "id": "self", "lineno": 325, "end_col_offset": 15, "src": "12034:4:0", "end_lineno": 325, "node_id": 470, "type": {"name": "self"}}, "lineno": 325, "end_col_offset": 25, "src": "12034:14:0", "end_lineno": 325, "node_id": 469, "attr": "is_minter", "type": {"key_type": {"name": "address"}, "value_type": {"name": "bool"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "is_minter", "decl_node": {"node_id": 159, "source_id": 0}, "access_path": []}]}, "lineno": 325, "end_col_offset": 37, "src": "12034:26:0", "slice": {"ast_type": "Attribute", "col_offset": 26, "value": {"ast_type": "Name", "col_offset": 26, "id": "msg", "lineno": 325, "end_col_offset": 29, "src": "12049:3:0", "end_lineno": 325, "node_id": 474, "type": {"name": "msg"}}, "lineno": 325, "end_col_offset": 36, "src": "12049:10:0", "end_lineno": 325, "node_id": 473, "attr": "sender", "type": {"name": "address"}}, "end_lineno": 325, "node_id": 468, "type": {"name": "bool"}, "variable_reads": [{"name": "is_minter", "decl_node": {"node_id": 159, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "end_col_offset": 64, "src": "12027:60:0", "end_lineno": 325, "node_id": 467}, {"ast_type": "Expr", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 4, "args": [{"ast_type": "Name", "col_offset": 15, "id": "owner", "lineno": 326, "end_col_offset": 20, "src": "12103:5:0", "end_lineno": 326, "node_id": 485, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 459, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 22, "id": "amount", "lineno": 326, "end_col_offset": 28, "src": "12110:6:0", "end_lineno": 326, "node_id": 487, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 462, "source_id": 0}, "access_path": []}]}], "lineno": 326, "end_col_offset": 29, "keywords": [], "src": "12092:25:0", "end_lineno": 326, "func": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 326, "end_col_offset": 8, "src": "12092:4:0", "end_lineno": 326, "node_id": 482, "type": {"name": "self"}}, "lineno": 326, "end_col_offset": 14, "src": "12092:10:0", "end_lineno": 326, "node_id": 481, "attr": "_mint", "type": {"name": "_mint", "type_decl_node": {"node_id": 989, "source_id": 0}, "typeclass": "contract_function"}, "variable_reads": [{"name": "totalSupply", "decl_node": {"node_id": 151, "source_id": 0}, "access_path": []}, {"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": []}, {"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": ["$subscript_access"]}], "variable_writes": [{"name": "totalSupply", "decl_node": {"node_id": 151, "source_id": 0}, "access_path": []}, {"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "node_id": 480, "type": {"name": "(void)"}}, "lineno": 326, "end_col_offset": 29, "src": "12092:25:0", "end_lineno": 326, "node_id": 479}], "args": {"ast_type": "arguments", "col_offset": 0, "defaults": [], "args": [{"ast_type": "arg", "col_offset": 9, "lineno": 317, "annotation": {"ast_type": "Name", "col_offset": 16, "id": "address", "lineno": 317, "end_col_offset": 23, "src": "11696:7:0", "end_lineno": 317, "node_id": 460}, "end_col_offset": 23, "src": "11689:14:0", "end_lineno": 317, "arg": "owner", "node_id": 459}, {"ast_type": "arg", "col_offset": 25, "lineno": 317, "annotation": {"ast_type": "Name", "col_offset": 33, "id": "uint256", "lineno": 317, "end_col_offset": 40, "src": "11713:7:0", "end_lineno": 317, "node_id": 463}, "end_col_offset": 40, "src": "11705:15:0", "end_lineno": 317, "arg": "amount", "node_id": 462}], "lineno": 317, "end_col_offset": 29, "default": null, "src": "11680:437:0", "end_lineno": 326, "node_id": 458}, "lineno": 317, "end_col_offset": 29, "pos": null, "src": "11680:437:0", "decorator_list": [{"ast_type": "Name", "col_offset": 1, "id": "external", "lineno": 316, "end_col_offset": 9, "src": "11671:8:0", "end_lineno": 316, "node_id": 489}], "end_lineno": 326, "node_id": 457, "doc_string": {"ast_type": "DocStr", "col_offset": 4, "value": "\n @dev Creates `amount` tokens and assigns them to `owner`.\n @notice Only authorised minters can access this function.\n Note that `owner` cannot be the zero address.\n @param owner The 20-byte owner address.\n @param amount The 32-byte token amount to be created.\n ", "lineno": 318, "end_col_offset": 7, "src": "11727:295:0", "end_lineno": 324, "node_id": 491}, "name": "mint"}, {"ast_type": "FunctionDef", "col_offset": 0, "returns": null, "body": [{"ast_type": "Expr", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 4, "args": [], "lineno": 341, "end_col_offset": 26, "keywords": [], "src": "12623:22:0", "end_lineno": 341, "func": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "ownable", "lineno": 341, "end_col_offset": 11, "src": "12623:7:0", "end_lineno": 341, "node_id": 505, "type": {"name": "src/snekmate/auth/ownable.vy", "type_decl_node": {"node_id": 0, "source_id": 3}, "typeclass": "module"}}, "lineno": 341, "end_col_offset": 24, "src": "12623:20:0", "end_lineno": 341, "node_id": 504, "attr": "_check_owner", "type": {"name": "_check_owner", "type_decl_node": {"node_id": 106, "source_id": 3}, "typeclass": "contract_function"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 3, "source_id": 3}, "access_path": []}]}, "node_id": 503, "type": {"name": "(void)"}}, "lineno": 341, "end_col_offset": 26, "src": "12623:22:0", "end_lineno": 341, "node_id": 502}, {"msg": {"ast_type": "Str", "col_offset": 37, "value": "erc20: minter is the zero address", "lineno": 342, "end_col_offset": 72, "src": "12683:35:0", "end_lineno": 342, "node_id": 518, "type": {"length": 33, "name": "String", "typeclass": "string"}}, "ast_type": "Assert", "col_offset": 4, "lineno": 342, "test": {"op": {"ast_type": "NotEq", "col_offset": 11, "lineno": 342, "end_col_offset": 35, "src": "12657:24:0", "end_lineno": 342, "node_id": 1244}, "ast_type": "Compare", "right": {"ast_type": "Call", "col_offset": 21, "args": [{"ast_type": "Name", "col_offset": 27, "id": "address", "lineno": 342, "end_col_offset": 34, "src": "12673:7:0", "end_lineno": 342, "node_id": 516, "type": {"type_t": {"name": "address"}}}], "lineno": 342, "end_col_offset": 35, "keywords": [], "src": "12667:14:0", "end_lineno": 342, "func": {"ast_type": "Name", "col_offset": 21, "id": "empty", "lineno": 342, "end_col_offset": 26, "src": "12667:5:0", "end_lineno": 342, "node_id": 514, "type": {"name": "empty", "typeclass": "builtin_function"}}, "node_id": 513, "type": {"name": "address"}}, "col_offset": 11, "left": {"ast_type": "Name", "col_offset": 11, "id": "minter", "lineno": 342, "end_col_offset": 17, "src": "12657:6:0", "end_lineno": 342, "node_id": 510, "type": {"name": "address"}, "variable_reads": [{"name": "minter", "decl_node": {"node_id": 494, "source_id": 0}, "access_path": []}]}, "lineno": 342, "end_col_offset": 35, "src": "12657:24:0", "end_lineno": 342, "node_id": 509, "type": {"name": "bool"}}, "end_col_offset": 72, "src": "12650:68:0", "end_lineno": 342, "node_id": 508}, {"msg": {"ast_type": "Str", "col_offset": 33, "value": "erc20: minter is owner address", "lineno": 345, "end_col_offset": 65, "src": "12853:32:0", "end_lineno": 345, "node_id": 528, "type": {"length": 30, "name": "String", "typeclass": "string"}}, "ast_type": "Assert", "col_offset": 4, "lineno": 345, "test": {"op": {"ast_type": "NotEq", "col_offset": 11, "lineno": 342, "end_col_offset": 35, "src": "12657:24:0", "end_lineno": 342, "node_id": 1244}, "ast_type": "Compare", "right": {"ast_type": "Attribute", "col_offset": 21, "value": {"ast_type": "Name", "col_offset": 21, "id": "msg", "lineno": 345, "end_col_offset": 24, "src": "12841:3:0", "end_lineno": 345, "node_id": 525, "type": {"name": "msg"}}, "lineno": 345, "end_col_offset": 31, "src": "12841:10:0", "end_lineno": 345, "node_id": 524, "attr": "sender", "type": {"name": "address"}}, "col_offset": 11, "left": {"ast_type": "Name", "col_offset": 11, "id": "minter", "lineno": 345, "end_col_offset": 17, "src": "12831:6:0", "end_lineno": 345, "node_id": 521, "type": {"name": "address"}, "variable_reads": [{"name": "minter", "decl_node": {"node_id": 494, "source_id": 0}, "access_path": []}]}, "lineno": 345, "end_col_offset": 31, "src": "12831:20:0", "end_lineno": 345, "node_id": 520, "type": {"name": "bool"}}, "end_col_offset": 65, "src": "12824:61:0", "end_lineno": 345, "node_id": 519}, {"target": {"ast_type": "Subscript", "col_offset": 4, "value": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 346, "end_col_offset": 8, "src": "12890:4:0", "end_lineno": 346, "node_id": 532, "type": {"name": "self"}}, "lineno": 346, "end_col_offset": 18, "src": "12890:14:0", "end_lineno": 346, "node_id": 531, "attr": "is_minter", "type": {"key_type": {"name": "address"}, "value_type": {"name": "bool"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "is_minter", "decl_node": {"node_id": 159, "source_id": 0}, "access_path": []}]}, "lineno": 346, "end_col_offset": 26, "src": "12890:22:0", "slice": {"ast_type": "Name", "col_offset": 19, "id": "minter", "lineno": 346, "end_col_offset": 25, "src": "12905:6:0", "end_lineno": 346, "node_id": 535, "type": {"name": "address"}, "variable_reads": [{"name": "minter", "decl_node": {"node_id": 494, "source_id": 0}, "access_path": []}]}, "end_lineno": 346, "node_id": 530, "type": {"name": "bool"}, "variable_reads": [{"name": "is_minter", "decl_node": {"node_id": 159, "source_id": 0}, "access_path": ["$subscript_access"]}], "variable_writes": [{"name": "is_minter", "decl_node": {"node_id": 159, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "ast_type": "Assign", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 29, "id": "status", "lineno": 346, "end_col_offset": 35, "src": "12915:6:0", "end_lineno": 346, "node_id": 538, "type": {"name": "bool"}, "variable_reads": [{"name": "status", "decl_node": {"node_id": 497, "source_id": 0}, "access_path": []}]}, "lineno": 346, "end_col_offset": 35, "src": "12890:31:0", "end_lineno": 346, "node_id": 529}, {"ast_type": "Log", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 8, "args": [], "lineno": 347, "end_col_offset": 55, "keywords": [{"ast_type": "keyword", "col_offset": 26, "value": {"ast_type": "Name", "col_offset": 33, "id": "minter", "lineno": 347, "end_col_offset": 39, "src": "12955:6:0", "end_lineno": 347, "node_id": 546, "type": {"name": "address"}, "variable_reads": [{"name": "minter", "decl_node": {"node_id": 494, "source_id": 0}, "access_path": []}]}, "lineno": 347, "end_col_offset": 39, "src": "12948:13:0", "end_lineno": 347, "arg": "minter", "node_id": 545}, {"ast_type": "keyword", "col_offset": 41, "value": {"ast_type": "Name", "col_offset": 48, "id": "status", "lineno": 347, "end_col_offset": 54, "src": "12970:6:0", "end_lineno": 347, "node_id": 549, "type": {"name": "bool"}, "variable_reads": [{"name": "status", "decl_node": {"node_id": 497, "source_id": 0}, "access_path": []}]}, "lineno": 347, "end_col_offset": 54, "src": "12963:13:0", "end_lineno": 347, "arg": "status", "node_id": 548}], "src": "12930:47:0", "end_lineno": 347, "func": {"ast_type": "Name", "col_offset": 8, "id": "RoleMinterChanged", "lineno": 347, "end_col_offset": 25, "src": "12930:17:0", "end_lineno": 347, "node_id": 543, "type": {"type_t": {"name": "RoleMinterChanged", "type_decl_node": {"node_id": 191, "source_id": 0}, "typeclass": "event"}}}, "node_id": 542, "type": {"name": "(void)"}}, "lineno": 347, "end_col_offset": 55, "src": "12926:51:0", "end_lineno": 347, "node_id": 541, "type": {"name": "RoleMinterChanged", "type_decl_node": {"node_id": 191, "source_id": 0}, "typeclass": "event"}}], "args": {"ast_type": "arguments", "col_offset": 0, "defaults": [], "args": [{"ast_type": "arg", "col_offset": 15, "lineno": 330, "annotation": {"ast_type": "Name", "col_offset": 23, "id": "address", "lineno": 330, "end_col_offset": 30, "src": "12153:7:0", "end_lineno": 330, "node_id": 495}, "end_col_offset": 30, "src": "12145:15:0", "end_lineno": 330, "arg": "minter", "node_id": 494}, {"ast_type": "arg", "col_offset": 32, "lineno": 330, "annotation": {"ast_type": "Name", "col_offset": 40, "id": "bool", "lineno": 330, "end_col_offset": 44, "src": "12170:4:0", "end_lineno": 330, "node_id": 498}, "end_col_offset": 44, "src": "12162:12:0", "end_lineno": 330, "arg": "status", "node_id": 497}], "lineno": 330, "end_col_offset": 55, "default": null, "src": "12130:847:0", "end_lineno": 347, "node_id": 493}, "lineno": 330, "end_col_offset": 55, "pos": null, "src": "12130:847:0", "decorator_list": [{"ast_type": "Name", "col_offset": 1, "id": "external", "lineno": 329, "end_col_offset": 9, "src": "12121:8:0", "end_lineno": 329, "node_id": 551}], "end_lineno": 347, "node_id": 492, "doc_string": {"ast_type": "DocStr", "col_offset": 4, "value": "\n @dev Adds or removes an address `minter` to/from the\n list of allowed minters. Note that only the\n `owner` can add or remove `minter` addresses.\n Also, the `minter` cannot be the zero address.\n Eventually, the `owner` cannot remove himself\n from the list of allowed minters.\n @param minter The 20-byte minter address.\n @param status The Boolean variable that sets the status.\n ", "lineno": 331, "end_col_offset": 7, "src": "12181:437:0", "end_lineno": 340, "node_id": 553}, "name": "set_minter"}, {"ast_type": "FunctionDef", "col_offset": 0, "returns": null, "body": [{"msg": {"ast_type": "Str", "col_offset": 40, "value": "erc20: expired deadline", "lineno": 372, "end_col_offset": 65, "src": "14124:25:0", "end_lineno": 372, "node_id": 588, "type": {"length": 23, "name": "String", "typeclass": "string"}}, "ast_type": "Assert", "col_offset": 4, "lineno": 372, "test": {"op": {"ast_type": "LtE", "col_offset": 11, "lineno": 372, "end_col_offset": 38, "src": "14095:27:0", "end_lineno": 372, "node_id": 585}, "ast_type": "Compare", "right": {"ast_type": "Name", "col_offset": 30, "id": "deadline", "lineno": 372, "end_col_offset": 38, "src": "14114:8:0", "end_lineno": 372, "node_id": 586, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "deadline", "decl_node": {"node_id": 565, "source_id": 0}, "access_path": []}]}, "col_offset": 11, "left": {"ast_type": "Attribute", "col_offset": 11, "value": {"ast_type": "Name", "col_offset": 11, "id": "block", "lineno": 372, "end_col_offset": 16, "src": "14095:5:0", "end_lineno": 372, "node_id": 582, "type": {"name": "block"}}, "lineno": 372, "end_col_offset": 26, "src": "14095:15:0", "end_lineno": 372, "node_id": 581, "attr": "timestamp", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "lineno": 372, "end_col_offset": 38, "src": "14095:27:0", "end_lineno": 372, "node_id": 580, "type": {"name": "bool"}}, "end_col_offset": 65, "src": "14088:61:0", "end_lineno": 372, "node_id": 579}, {"target": {"ast_type": "Name", "col_offset": 4, "id": "current_nonce", "lineno": 374, "end_col_offset": 17, "src": "14155:13:0", "end_lineno": 374, "node_id": 590, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "current_nonce", "decl_node": {"node_id": 589, "source_id": 0}, "access_path": []}]}, "ast_type": "AnnAssign", "col_offset": 4, "value": {"ast_type": "Subscript", "col_offset": 29, "value": {"ast_type": "Attribute", "col_offset": 29, "value": {"ast_type": "Name", "col_offset": 29, "id": "self", "lineno": 374, "end_col_offset": 33, "src": "14180:4:0", "end_lineno": 374, "node_id": 596, "type": {"name": "self"}}, "lineno": 374, "end_col_offset": 40, "src": "14180:11:0", "end_lineno": 374, "node_id": 595, "attr": "nonces", "type": {"key_type": {"name": "address"}, "value_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "nonces", "decl_node": {"node_id": 175, "source_id": 0}, "access_path": []}]}, "lineno": 374, "end_col_offset": 47, "src": "14180:18:0", "slice": {"ast_type": "Name", "col_offset": 41, "id": "owner", "lineno": 374, "end_col_offset": 46, "src": "14192:5:0", "end_lineno": 374, "node_id": 599, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 556, "source_id": 0}, "access_path": []}]}, "end_lineno": 374, "node_id": 594, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "nonces", "decl_node": {"node_id": 175, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "lineno": 374, "annotation": {"ast_type": "Name", "col_offset": 19, "id": "uint256", "lineno": 374, "end_col_offset": 26, "src": "14170:7:0", "end_lineno": 374, "node_id": 592}, "end_col_offset": 47, "src": "14155:43:0", "end_lineno": 374, "node_id": 589}, {"target": {"ast_type": "Subscript", "col_offset": 4, "value": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 375, "end_col_offset": 8, "src": "14203:4:0", "end_lineno": 375, "node_id": 605, "type": {"name": "self"}}, "lineno": 375, "end_col_offset": 15, "src": "14203:11:0", "end_lineno": 375, "node_id": 604, "attr": "nonces", "type": {"key_type": {"name": "address"}, "value_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "nonces", "decl_node": {"node_id": 175, "source_id": 0}, "access_path": []}]}, "lineno": 375, "end_col_offset": 22, "src": "14203:18:0", "slice": {"ast_type": "Name", "col_offset": 16, "id": "owner", "lineno": 375, "end_col_offset": 21, "src": "14215:5:0", "end_lineno": 375, "node_id": 608, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 556, "source_id": 0}, "access_path": []}]}, "end_lineno": 375, "node_id": 603, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "nonces", "decl_node": {"node_id": 175, "source_id": 0}, "access_path": ["$subscript_access"]}], "variable_writes": [{"name": "nonces", "decl_node": {"node_id": 175, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "ast_type": "Assign", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 25, "args": [{"ast_type": "Name", "col_offset": 36, "id": "current_nonce", "lineno": 375, "end_col_offset": 49, "src": "14235:13:0", "end_lineno": 375, "node_id": 614, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "current_nonce", "decl_node": {"node_id": 589, "source_id": 0}, "access_path": []}]}, {"ast_type": "Int", "col_offset": 51, "value": 1, "lineno": 375, "end_col_offset": 52, "src": "14250:1:0", "end_lineno": 375, "node_id": 616, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}], "lineno": 375, "end_col_offset": 53, "keywords": [], "src": "14224:28:0", "end_lineno": 375, "func": {"ast_type": "Name", "col_offset": 25, "id": "unsafe_add", "lineno": 375, "end_col_offset": 35, "src": "14224:10:0", "end_lineno": 375, "node_id": 612, "type": {"name": "unsafe_add", "typeclass": "builtin_function"}}, "node_id": 611, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "lineno": 375, "end_col_offset": 53, "src": "14203:49:0", "end_lineno": 375, "node_id": 602}, {"target": {"ast_type": "Name", "col_offset": 4, "id": "struct_hash", "lineno": 377, "end_col_offset": 15, "src": "14258:11:0", "end_lineno": 377, "node_id": 618, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "struct_hash", "decl_node": {"node_id": 617, "source_id": 0}, "access_path": []}]}, "ast_type": "AnnAssign", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 27, "args": [{"ast_type": "Call", "col_offset": 37, "args": [{"ast_type": "Name", "col_offset": 48, "id": "_PERMIT_TYPE_HASH", "lineno": 377, "end_col_offset": 65, "src": "14302:17:0", "end_lineno": 377, "node_id": 628, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "_PERMIT_TYPE_HASH", "decl_node": {"node_id": 60, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 67, "id": "owner", "lineno": 377, "end_col_offset": 72, "src": "14321:5:0", "end_lineno": 377, "node_id": 630, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 556, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 74, "id": "spender", "lineno": 377, "end_col_offset": 81, "src": "14328:7:0", "end_lineno": 377, "node_id": 632, "type": {"name": "address"}, "variable_reads": [{"name": "spender", "decl_node": {"node_id": 559, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 83, "id": "amount", "lineno": 377, "end_col_offset": 89, "src": "14337:6:0", "end_lineno": 377, "node_id": 634, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 562, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 91, "id": "current_nonce", "lineno": 377, "end_col_offset": 104, "src": "14345:13:0", "end_lineno": 377, "node_id": 636, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "current_nonce", "decl_node": {"node_id": 589, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 106, "id": "deadline", "lineno": 377, "end_col_offset": 114, "src": "14360:8:0", "end_lineno": 377, "node_id": 638, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "deadline", "decl_node": {"node_id": 565, "source_id": 0}, "access_path": []}]}], "lineno": 377, "end_col_offset": 115, "keywords": [], "src": "14291:78:0", "end_lineno": 377, "func": {"ast_type": "Name", "col_offset": 37, "id": "abi_encode", "lineno": 377, "end_col_offset": 47, "src": "14291:10:0", "end_lineno": 377, "node_id": 626, "type": {"name": "abi_encode", "typeclass": "builtin_function"}}, "node_id": 625, "type": {"length": 192, "name": "Bytes", "typeclass": "bytes"}}], "lineno": 377, "end_col_offset": 116, "keywords": [], "src": "14281:89:0", "end_lineno": 377, "func": {"ast_type": "Name", "col_offset": 27, "id": "keccak256", "lineno": 377, "end_col_offset": 36, "src": "14281:9:0", "end_lineno": 377, "node_id": 623, "type": {"name": "keccak256", "typeclass": "builtin_function"}}, "node_id": 622, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}}, "lineno": 377, "annotation": {"ast_type": "Name", "col_offset": 17, "id": "bytes32", "lineno": 377, "end_col_offset": 24, "src": "14271:7:0", "end_lineno": 377, "node_id": 620}, "end_col_offset": 116, "src": "14258:112:0", "end_lineno": 377, "node_id": 617}, {"target": {"ast_type": "Name", "col_offset": 4, "id": "hash", "lineno": 378, "end_col_offset": 8, "src": "14375:4:0", "end_lineno": 378, "node_id": 641, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "hash", "decl_node": {"node_id": 640, "source_id": 0}, "access_path": []}]}, "ast_type": "AnnAssign", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 20, "args": [{"ast_type": "Name", "col_offset": 64, "id": "struct_hash", "lineno": 378, "end_col_offset": 75, "src": "14435:11:0", "end_lineno": 378, "node_id": 650, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "struct_hash", "decl_node": {"node_id": 617, "source_id": 0}, "access_path": []}]}], "lineno": 378, "end_col_offset": 76, "keywords": [], "src": "14391:56:0", "end_lineno": 378, "func": {"ast_type": "Attribute", "col_offset": 20, "value": {"ast_type": "Name", "col_offset": 20, "id": "eip712_domain_separator", "lineno": 378, "end_col_offset": 43, "src": "14391:23:0", "end_lineno": 378, "node_id": 647, "type": {"name": "src/snekmate/utils/eip712_domain_separator.vy", "type_decl_node": {"node_id": 0, "source_id": 5}, "typeclass": "module"}}, "lineno": 378, "end_col_offset": 63, "src": "14391:43:0", "end_lineno": 378, "node_id": 646, "attr": "_hash_typed_data_v4", "type": {"name": "_hash_typed_data_v4", "type_decl_node": {"node_id": 289, "source_id": 5}, "typeclass": "contract_function"}, "variable_reads": [{"name": "_CACHED_SELF", "decl_node": {"node_id": 40, "source_id": 5}, "access_path": []}, {"name": "_CACHED_CHAIN_ID", "decl_node": {"node_id": 32, "source_id": 5}, "access_path": []}, {"name": "_CACHED_DOMAIN_SEPARATOR", "decl_node": {"node_id": 24, "source_id": 5}, "access_path": []}, {"name": "_HASHED_NAME", "decl_node": {"node_id": 59, "source_id": 5}, "access_path": []}, {"name": "_HASHED_VERSION", "decl_node": {"node_id": 78, "source_id": 5}, "access_path": []}]}, "node_id": 645, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}}, "lineno": 378, "annotation": {"ast_type": "Name", "col_offset": 10, "id": "bytes32", "lineno": 378, "end_col_offset": 17, "src": "14381:7:0", "end_lineno": 378, "node_id": 643}, "end_col_offset": 76, "src": "14375:72:0", "end_lineno": 378, "node_id": 640}, {"target": {"ast_type": "Name", "col_offset": 4, "id": "signer", "lineno": 380, "end_col_offset": 10, "src": "14453:6:0", "end_lineno": 380, "node_id": 653, "type": {"name": "address"}, "variable_reads": [{"name": "signer", "decl_node": {"node_id": 652, "source_id": 0}, "access_path": []}]}, "ast_type": "AnnAssign", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 22, "args": [{"ast_type": "Name", "col_offset": 41, "id": "hash", "lineno": 380, "end_col_offset": 45, "src": "14490:4:0", "end_lineno": 380, "node_id": 662, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "hash", "decl_node": {"node_id": 640, "source_id": 0}, "access_path": []}]}, {"ast_type": "Call", "col_offset": 47, "args": [{"ast_type": "Name", "col_offset": 55, "id": "v", "lineno": 380, "end_col_offset": 56, "src": "14504:1:0", "end_lineno": 380, "node_id": 667, "type": {"is_signed": false, "bits": 8, "name": "uint8", "typeclass": "integer"}, "variable_reads": [{"name": "v", "decl_node": {"node_id": 568, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 58, "id": "uint256", "lineno": 380, "end_col_offset": 65, "src": "14507:7:0", "end_lineno": 380, "node_id": 669, "type": {"type_t": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}}], "lineno": 380, "end_col_offset": 66, "keywords": [], "src": "14496:19:0", "end_lineno": 380, "func": {"ast_type": "Name", "col_offset": 47, "id": "convert", "lineno": 380, "end_col_offset": 54, "src": "14496:7:0", "end_lineno": 380, "node_id": 665, "type": {"name": "convert", "typeclass": "builtin_function"}}, "node_id": 664, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, {"ast_type": "Call", "col_offset": 68, "args": [{"ast_type": "Name", "col_offset": 76, "id": "r", "lineno": 380, "end_col_offset": 77, "src": "14525:1:0", "end_lineno": 380, "node_id": 674, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "r", "decl_node": {"node_id": 571, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 79, "id": "uint256", "lineno": 380, "end_col_offset": 86, "src": "14528:7:0", "end_lineno": 380, "node_id": 676, "type": {"type_t": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}}], "lineno": 380, "end_col_offset": 87, "keywords": [], "src": "14517:19:0", "end_lineno": 380, "func": {"ast_type": "Name", "col_offset": 68, "id": "convert", "lineno": 380, "end_col_offset": 75, "src": "14517:7:0", "end_lineno": 380, "node_id": 672, "type": {"name": "convert", "typeclass": "builtin_function"}}, "node_id": 671, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, {"ast_type": "Call", "col_offset": 89, "args": [{"ast_type": "Name", "col_offset": 97, "id": "s", "lineno": 380, "end_col_offset": 98, "src": "14546:1:0", "end_lineno": 380, "node_id": 681, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "s", "decl_node": {"node_id": 574, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 100, "id": "uint256", "lineno": 380, "end_col_offset": 107, "src": "14549:7:0", "end_lineno": 380, "node_id": 683, "type": {"type_t": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}}], "lineno": 380, "end_col_offset": 108, "keywords": [], "src": "14538:19:0", "end_lineno": 380, "func": {"ast_type": "Name", "col_offset": 89, "id": "convert", "lineno": 380, "end_col_offset": 96, "src": "14538:7:0", "end_lineno": 380, "node_id": 679, "type": {"name": "convert", "typeclass": "builtin_function"}}, "node_id": 678, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}], "lineno": 380, "end_col_offset": 109, "keywords": [], "src": "14471:87:0", "end_lineno": 380, "func": {"ast_type": "Attribute", "col_offset": 22, "value": {"ast_type": "Name", "col_offset": 22, "id": "ecdsa", "lineno": 380, "end_col_offset": 27, "src": "14471:5:0", "end_lineno": 380, "node_id": 659, "type": {"name": "src/snekmate/utils/ecdsa.vy", "type_decl_node": {"node_id": 0, "source_id": 4}, "typeclass": "module"}}, "lineno": 380, "end_col_offset": 40, "src": "14471:18:0", "end_lineno": 380, "node_id": 658, "attr": "_recover_vrs", "type": {"name": "_recover_vrs", "type_decl_node": {"node_id": 177, "source_id": 4}, "typeclass": "contract_function"}}, "node_id": 657, "type": {"name": "address"}}, "lineno": 380, "annotation": {"ast_type": "Name", "col_offset": 12, "id": "address", "lineno": 380, "end_col_offset": 19, "src": "14461:7:0", "end_lineno": 380, "node_id": 655}, "end_col_offset": 109, "src": "14453:105:0", "end_lineno": 380, "node_id": 652}, {"msg": {"ast_type": "Str", "col_offset": 28, "value": "erc20: invalid signature", "lineno": 381, "end_col_offset": 54, "src": "14587:26:0", "end_lineno": 381, "node_id": 692, "type": {"length": 24, "name": "String", "typeclass": "string"}}, "ast_type": "Assert", "col_offset": 4, "lineno": 381, "test": {"op": {"ast_type": "Eq", "col_offset": 11, "lineno": 381, "end_col_offset": 26, "src": "14570:15:0", "end_lineno": 381, "node_id": 689}, "ast_type": "Compare", "right": {"ast_type": "Name", "col_offset": 21, "id": "owner", "lineno": 381, "end_col_offset": 26, "src": "14580:5:0", "end_lineno": 381, "node_id": 690, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 556, "source_id": 0}, "access_path": []}]}, "col_offset": 11, "left": {"ast_type": "Name", "col_offset": 11, "id": "signer", "lineno": 381, "end_col_offset": 17, "src": "14570:6:0", "end_lineno": 381, "node_id": 687, "type": {"name": "address"}, "variable_reads": [{"name": "signer", "decl_node": {"node_id": 652, "source_id": 0}, "access_path": []}]}, "lineno": 381, "end_col_offset": 26, "src": "14570:15:0", "end_lineno": 381, "node_id": 686, "type": {"name": "bool"}}, "end_col_offset": 54, "src": "14563:50:0", "end_lineno": 381, "node_id": 685}, {"ast_type": "Expr", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 4, "args": [{"ast_type": "Name", "col_offset": 18, "id": "owner", "lineno": 383, "end_col_offset": 23, "src": "14633:5:0", "end_lineno": 383, "node_id": 699, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 556, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 25, "id": "spender", "lineno": 383, "end_col_offset": 32, "src": "14640:7:0", "end_lineno": 383, "node_id": 701, "type": {"name": "address"}, "variable_reads": [{"name": "spender", "decl_node": {"node_id": 559, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 34, "id": "amount", "lineno": 383, "end_col_offset": 40, "src": "14649:6:0", "end_lineno": 383, "node_id": 703, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 562, "source_id": 0}, "access_path": []}]}], "lineno": 383, "end_col_offset": 41, "keywords": [], "src": "14619:37:0", "end_lineno": 383, "func": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 383, "end_col_offset": 8, "src": "14619:4:0", "end_lineno": 383, "node_id": 696, "type": {"name": "self"}}, "lineno": 383, "end_col_offset": 17, "src": "14619:13:0", "end_lineno": 383, "node_id": 695, "attr": "_approve", "type": {"name": "_approve", "type_decl_node": {"node_id": 1216, "source_id": 0}, "typeclass": "contract_function"}, "variable_reads": [{"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": []}, {"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": ["$subscript_access"]}, {"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}], "variable_writes": [{"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}]}, "node_id": 694, "type": {"name": "(void)"}}, "lineno": 383, "end_col_offset": 41, "src": "14619:37:0", "end_lineno": 383, "node_id": 693}], "args": {"ast_type": "arguments", "col_offset": 0, "defaults": [], "args": [{"ast_type": "arg", "col_offset": 11, "lineno": 351, "annotation": {"ast_type": "Name", "col_offset": 18, "id": "address", "lineno": 351, "end_col_offset": 25, "src": "13008:7:0", "end_lineno": 351, "node_id": 557}, "end_col_offset": 25, "src": "13001:14:0", "end_lineno": 351, "arg": "owner", "node_id": 556}, {"ast_type": "arg", "col_offset": 27, "lineno": 351, "annotation": {"ast_type": "Name", "col_offset": 36, "id": "address", "lineno": 351, "end_col_offset": 43, "src": "13026:7:0", "end_lineno": 351, "node_id": 560}, "end_col_offset": 43, "src": "13017:16:0", "end_lineno": 351, "arg": "spender", "node_id": 559}, {"ast_type": "arg", "col_offset": 45, "lineno": 351, "annotation": {"ast_type": "Name", "col_offset": 53, "id": "uint256", "lineno": 351, "end_col_offset": 60, "src": "13043:7:0", "end_lineno": 351, "node_id": 563}, "end_col_offset": 60, "src": "13035:15:0", "end_lineno": 351, "arg": "amount", "node_id": 562}, {"ast_type": "arg", "col_offset": 62, "lineno": 351, "annotation": {"ast_type": "Name", "col_offset": 72, "id": "uint256", "lineno": 351, "end_col_offset": 79, "src": "13062:7:0", "end_lineno": 351, "node_id": 566}, "end_col_offset": 79, "src": "13052:17:0", "end_lineno": 351, "arg": "deadline", "node_id": 565}, {"ast_type": "arg", "col_offset": 81, "lineno": 351, "annotation": {"ast_type": "Name", "col_offset": 84, "id": "uint8", "lineno": 351, "end_col_offset": 89, "src": "13074:5:0", "end_lineno": 351, "node_id": 569}, "end_col_offset": 89, "src": "13071:8:0", "end_lineno": 351, "arg": "v", "node_id": 568}, {"ast_type": "arg", "col_offset": 91, "lineno": 351, "annotation": {"ast_type": "Name", "col_offset": 94, "id": "bytes32", "lineno": 351, "end_col_offset": 101, "src": "13084:7:0", "end_lineno": 351, "node_id": 572}, "end_col_offset": 101, "src": "13081:10:0", "end_lineno": 351, "arg": "r", "node_id": 571}, {"ast_type": "arg", "col_offset": 103, "lineno": 351, "annotation": {"ast_type": "Name", "col_offset": 106, "id": "bytes32", "lineno": 351, "end_col_offset": 113, "src": "13096:7:0", "end_lineno": 351, "node_id": 575}, "end_col_offset": 113, "src": "13093:10:0", "end_lineno": 351, "arg": "s", "node_id": 574}], "lineno": 351, "end_col_offset": 41, "default": null, "src": "12990:1666:0", "end_lineno": 383, "node_id": 555}, "lineno": 351, "end_col_offset": 41, "pos": null, "src": "12990:1666:0", "decorator_list": [{"ast_type": "Name", "col_offset": 1, "id": "external", "lineno": 350, "end_col_offset": 9, "src": "12981:8:0", "end_lineno": 350, "node_id": 705}], "end_lineno": 383, "node_id": 554, "doc_string": {"ast_type": "DocStr", "col_offset": 4, "value": "\n @dev Sets `amount` as the allowance of `spender`\n over `owner`'s tokens, given `owner`'s signed\n approval.\n @notice Note that `spender` cannot be the zero address.\n Also, `deadline` must be a block timestamp in\n the future. `v`, `r`, and `s` must be a valid\n secp256k1 signature from `owner` over the\n EIP-712-formatted function arguments. Eventually,\n the signature must use `owner`'s current nonce.\n @param owner The 20-byte owner address.\n @param spender The 20-byte spender address.\n @param amount The 32-byte token amount that is\n allowed to be spent by the `spender`.\n @param deadline The 32-byte block timestamp up\n which the `spender` is allowed to spend `amount`.\n @param v The secp256k1 1-byte signature parameter `v`.\n @param r The secp256k1 32-byte signature parameter `r`.\n @param s The secp256k1 32-byte signature parameter `s`.\n ", "lineno": 352, "end_col_offset": 7, "src": "13110:973:0", "end_lineno": 371, "node_id": 707}, "name": "permit"}, {"ast_type": "FunctionDef", "col_offset": 0, "returns": {"ast_type": "Name", "col_offset": 26, "id": "bytes32", "lineno": 388, "end_col_offset": 33, "src": "14701:7:0", "end_lineno": 388, "node_id": 722}, "body": [{"ast_type": "Return", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 11, "args": [], "lineno": 393, "end_col_offset": 57, "keywords": [], "src": "14848:46:0", "end_lineno": 393, "func": {"ast_type": "Attribute", "col_offset": 11, "value": {"ast_type": "Name", "col_offset": 11, "id": "eip712_domain_separator", "lineno": 393, "end_col_offset": 34, "src": "14848:23:0", "end_lineno": 393, "node_id": 715, "type": {"name": "src/snekmate/utils/eip712_domain_separator.vy", "type_decl_node": {"node_id": 0, "source_id": 5}, "typeclass": "module"}}, "lineno": 393, "end_col_offset": 55, "src": "14848:44:0", "end_lineno": 393, "node_id": 714, "attr": "_domain_separator_v4", "type": {"name": "_domain_separator_v4", "type_decl_node": {"node_id": 222, "source_id": 5}, "typeclass": "contract_function"}, "variable_reads": [{"name": "_CACHED_SELF", "decl_node": {"node_id": 40, "source_id": 5}, "access_path": []}, {"name": "_CACHED_CHAIN_ID", "decl_node": {"node_id": 32, "source_id": 5}, "access_path": []}, {"name": "_CACHED_DOMAIN_SEPARATOR", "decl_node": {"node_id": 24, "source_id": 5}, "access_path": []}, {"name": "_HASHED_NAME", "decl_node": {"node_id": 59, "source_id": 5}, "access_path": []}, {"name": "_HASHED_VERSION", "decl_node": {"node_id": 78, "source_id": 5}, "access_path": []}]}, "node_id": 713, "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}}, "lineno": 393, "end_col_offset": 57, "src": "14841:53:0", "end_lineno": 393, "node_id": 712}], "args": {"ast_type": "arguments", "col_offset": 0, "defaults": [], "args": [], "lineno": 388, "end_col_offset": 57, "default": null, "src": "14675:219:0", "end_lineno": 393, "node_id": 709}, "lineno": 388, "end_col_offset": 57, "pos": null, "src": "14675:219:0", "decorator_list": [{"ast_type": "Name", "col_offset": 1, "id": "external", "lineno": 386, "end_col_offset": 9, "src": "14660:8:0", "end_lineno": 386, "node_id": 718}, {"ast_type": "Name", "col_offset": 1, "id": "view", "lineno": 387, "end_col_offset": 5, "src": "14670:4:0", "end_lineno": 387, "node_id": 720}], "end_lineno": 393, "node_id": 708, "doc_string": {"ast_type": "DocStr", "col_offset": 4, "value": "\n @dev Returns the domain separator for the current chain.\n @return bytes32 The 32-byte domain separator.\n ", "lineno": 389, "end_col_offset": 7, "src": "14714:122:0", "end_lineno": 392, "node_id": 724}, "name": "DOMAIN_SEPARATOR"}, {"ast_type": "FunctionDef", "col_offset": 0, "returns": null, "body": [{"ast_type": "Expr", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 4, "args": [], "lineno": 410, "end_col_offset": 26, "keywords": [], "src": "15442:22:0", "end_lineno": 410, "func": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "ownable", "lineno": 410, "end_col_offset": 11, "src": "15442:7:0", "end_lineno": 410, "node_id": 735, "type": {"name": "src/snekmate/auth/ownable.vy", "type_decl_node": {"node_id": 0, "source_id": 3}, "typeclass": "module"}}, "lineno": 410, "end_col_offset": 24, "src": "15442:20:0", "end_lineno": 410, "node_id": 734, "attr": "_check_owner", "type": {"name": "_check_owner", "type_decl_node": {"node_id": 106, "source_id": 3}, "typeclass": "contract_function"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 3, "source_id": 3}, "access_path": []}]}, "node_id": 733, "type": {"name": "(void)"}}, "lineno": 410, "end_col_offset": 26, "src": "15442:22:0", "end_lineno": 410, "node_id": 732}, {"msg": {"ast_type": "Str", "col_offset": 40, "value": "erc20: new owner is the zero address", "lineno": 411, "end_col_offset": 78, "src": "15505:38:0", "end_lineno": 411, "node_id": 748, "type": {"length": 36, "name": "String", "typeclass": "string"}}, "ast_type": "Assert", "col_offset": 4, "lineno": 411, "test": {"op": {"ast_type": "NotEq", "col_offset": 11, "lineno": 342, "end_col_offset": 35, "src": "12657:24:0", "end_lineno": 342, "node_id": 1244}, "ast_type": "Compare", "right": {"ast_type": "Call", "col_offset": 24, "args": [{"ast_type": "Name", "col_offset": 30, "id": "address", "lineno": 411, "end_col_offset": 37, "src": "15495:7:0", "end_lineno": 411, "node_id": 746, "type": {"type_t": {"name": "address"}}}], "lineno": 411, "end_col_offset": 38, "keywords": [], "src": "15489:14:0", "end_lineno": 411, "func": {"ast_type": "Name", "col_offset": 24, "id": "empty", "lineno": 411, "end_col_offset": 29, "src": "15489:5:0", "end_lineno": 411, "node_id": 744, "type": {"name": "empty", "typeclass": "builtin_function"}}, "node_id": 743, "type": {"name": "address"}}, "col_offset": 11, "left": {"ast_type": "Name", "col_offset": 11, "id": "new_owner", "lineno": 411, "end_col_offset": 20, "src": "15476:9:0", "end_lineno": 411, "node_id": 740, "type": {"name": "address"}, "variable_reads": [{"name": "new_owner", "decl_node": {"node_id": 727, "source_id": 0}, "access_path": []}]}, "lineno": 411, "end_col_offset": 38, "src": "15476:27:0", "end_lineno": 411, "node_id": 739, "type": {"name": "bool"}}, "end_col_offset": 78, "src": "15469:74:0", "end_lineno": 411, "node_id": 738}, {"target": {"ast_type": "Subscript", "col_offset": 4, "value": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 413, "end_col_offset": 8, "src": "15549:4:0", "end_lineno": 413, "node_id": 752, "type": {"name": "self"}}, "lineno": 413, "end_col_offset": 18, "src": "15549:14:0", "end_lineno": 413, "node_id": 751, "attr": "is_minter", "type": {"key_type": {"name": "address"}, "value_type": {"name": "bool"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "is_minter", "decl_node": {"node_id": 159, "source_id": 0}, "access_path": []}]}, "lineno": 413, "end_col_offset": 30, "src": "15549:26:0", "slice": {"ast_type": "Attribute", "col_offset": 19, "value": {"ast_type": "Name", "col_offset": 19, "id": "msg", "lineno": 413, "end_col_offset": 22, "src": "15564:3:0", "end_lineno": 413, "node_id": 756, "type": {"name": "msg"}}, "lineno": 413, "end_col_offset": 29, "src": "15564:10:0", "end_lineno": 413, "node_id": 755, "attr": "sender", "type": {"name": "address"}}, "end_lineno": 413, "node_id": 750, "type": {"name": "bool"}, "variable_reads": [{"name": "is_minter", "decl_node": {"node_id": 159, "source_id": 0}, "access_path": ["$subscript_access"]}], "variable_writes": [{"name": "is_minter", "decl_node": {"node_id": 159, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "ast_type": "Assign", "col_offset": 4, "value": {"ast_type": "NameConstant", "col_offset": 33, "value": false, "lineno": 413, "end_col_offset": 38, "src": "15578:5:0", "end_lineno": 413, "node_id": 760, "type": {"name": "bool"}}, "lineno": 413, "end_col_offset": 38, "src": "15549:34:0", "end_lineno": 413, "node_id": 749}, {"ast_type": "Log", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 8, "args": [], "lineno": 414, "end_col_offset": 58, "keywords": [{"ast_type": "keyword", "col_offset": 26, "value": {"ast_type": "Attribute", "col_offset": 33, "value": {"ast_type": "Name", "col_offset": 33, "id": "msg", "lineno": 414, "end_col_offset": 36, "src": "15617:3:0", "end_lineno": 414, "node_id": 768, "type": {"name": "msg"}}, "lineno": 414, "end_col_offset": 43, "src": "15617:10:0", "end_lineno": 414, "node_id": 767, "attr": "sender", "type": {"name": "address"}}, "lineno": 414, "end_col_offset": 43, "src": "15610:17:0", "end_lineno": 414, "arg": "minter", "node_id": 766}, {"ast_type": "keyword", "col_offset": 45, "value": {"ast_type": "NameConstant", "col_offset": 52, "value": false, "lineno": 414, "end_col_offset": 57, "src": "15636:5:0", "end_lineno": 414, "node_id": 772, "type": {"name": "bool"}}, "lineno": 414, "end_col_offset": 57, "src": "15629:12:0", "end_lineno": 414, "arg": "status", "node_id": 771}], "src": "15592:50:0", "end_lineno": 414, "func": {"ast_type": "Name", "col_offset": 8, "id": "RoleMinterChanged", "lineno": 414, "end_col_offset": 25, "src": "15592:17:0", "end_lineno": 414, "node_id": 764, "type": {"type_t": {"name": "RoleMinterChanged", "type_decl_node": {"node_id": 191, "source_id": 0}, "typeclass": "event"}}}, "node_id": 763, "type": {"name": "(void)"}}, "lineno": 414, "end_col_offset": 58, "src": "15588:54:0", "end_lineno": 414, "node_id": 762, "type": {"name": "RoleMinterChanged", "type_decl_node": {"node_id": 191, "source_id": 0}, "typeclass": "event"}}, {"ast_type": "Expr", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 4, "args": [{"ast_type": "Name", "col_offset": 32, "id": "new_owner", "lineno": 416, "end_col_offset": 41, "src": "15676:9:0", "end_lineno": 416, "node_id": 779, "type": {"name": "address"}, "variable_reads": [{"name": "new_owner", "decl_node": {"node_id": 727, "source_id": 0}, "access_path": []}]}], "lineno": 416, "end_col_offset": 42, "keywords": [], "src": "15648:38:0", "end_lineno": 416, "func": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "ownable", "lineno": 416, "end_col_offset": 11, "src": "15648:7:0", "end_lineno": 416, "node_id": 776, "type": {"name": "src/snekmate/auth/ownable.vy", "type_decl_node": {"node_id": 0, "source_id": 3}, "typeclass": "module"}}, "lineno": 416, "end_col_offset": 31, "src": "15648:27:0", "end_lineno": 416, "node_id": 775, "attr": "_transfer_ownership", "type": {"name": "_transfer_ownership", "type_decl_node": {"node_id": 125, "source_id": 3}, "typeclass": "contract_function"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 3, "source_id": 3}, "access_path": []}], "variable_writes": [{"name": "owner", "decl_node": {"node_id": 3, "source_id": 3}, "access_path": []}]}, "node_id": 774, "type": {"name": "(void)"}}, "lineno": 416, "end_col_offset": 42, "src": "15648:38:0", "end_lineno": 416, "node_id": 773}, {"target": {"ast_type": "Subscript", "col_offset": 4, "value": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 417, "end_col_offset": 8, "src": "15691:4:0", "end_lineno": 417, "node_id": 784, "type": {"name": "self"}}, "lineno": 417, "end_col_offset": 18, "src": "15691:14:0", "end_lineno": 417, "node_id": 783, "attr": "is_minter", "type": {"key_type": {"name": "address"}, "value_type": {"name": "bool"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "is_minter", "decl_node": {"node_id": 159, "source_id": 0}, "access_path": []}]}, "lineno": 417, "end_col_offset": 29, "src": "15691:25:0", "slice": {"ast_type": "Name", "col_offset": 19, "id": "new_owner", "lineno": 417, "end_col_offset": 28, "src": "15706:9:0", "end_lineno": 417, "node_id": 787, "type": {"name": "address"}, "variable_reads": [{"name": "new_owner", "decl_node": {"node_id": 727, "source_id": 0}, "access_path": []}]}, "end_lineno": 417, "node_id": 782, "type": {"name": "bool"}, "variable_reads": [{"name": "is_minter", "decl_node": {"node_id": 159, "source_id": 0}, "access_path": ["$subscript_access"]}], "variable_writes": [{"name": "is_minter", "decl_node": {"node_id": 159, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "ast_type": "Assign", "col_offset": 4, "value": {"ast_type": "NameConstant", "col_offset": 32, "value": true, "lineno": 417, "end_col_offset": 36, "src": "15719:4:0", "end_lineno": 417, "node_id": 790, "type": {"name": "bool"}}, "lineno": 417, "end_col_offset": 36, "src": "15691:32:0", "end_lineno": 417, "node_id": 781}, {"ast_type": "Log", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 8, "args": [], "lineno": 418, "end_col_offset": 56, "keywords": [{"ast_type": "keyword", "col_offset": 26, "value": {"ast_type": "Name", "col_offset": 33, "id": "new_owner", "lineno": 418, "end_col_offset": 42, "src": "15757:9:0", "end_lineno": 418, "node_id": 797, "type": {"name": "address"}, "variable_reads": [{"name": "new_owner", "decl_node": {"node_id": 727, "source_id": 0}, "access_path": []}]}, "lineno": 418, "end_col_offset": 42, "src": "15750:16:0", "end_lineno": 418, "arg": "minter", "node_id": 796}, {"ast_type": "keyword", "col_offset": 44, "value": {"ast_type": "NameConstant", "col_offset": 51, "value": true, "lineno": 418, "end_col_offset": 55, "src": "15775:4:0", "end_lineno": 418, "node_id": 800, "type": {"name": "bool"}}, "lineno": 418, "end_col_offset": 55, "src": "15768:11:0", "end_lineno": 418, "arg": "status", "node_id": 799}], "src": "15732:48:0", "end_lineno": 418, "func": {"ast_type": "Name", "col_offset": 8, "id": "RoleMinterChanged", "lineno": 418, "end_col_offset": 25, "src": "15732:17:0", "end_lineno": 418, "node_id": 794, "type": {"type_t": {"name": "RoleMinterChanged", "type_decl_node": {"node_id": 191, "source_id": 0}, "typeclass": "event"}}}, "node_id": 793, "type": {"name": "(void)"}}, "lineno": 418, "end_col_offset": 56, "src": "15728:52:0", "end_lineno": 418, "node_id": 792, "type": {"name": "RoleMinterChanged", "type_decl_node": {"node_id": 191, "source_id": 0}, "typeclass": "event"}}], "args": {"ast_type": "arguments", "col_offset": 0, "defaults": [], "args": [{"ast_type": "arg", "col_offset": 23, "lineno": 397, "annotation": {"ast_type": "Name", "col_offset": 34, "id": "address", "lineno": 397, "end_col_offset": 41, "src": "14941:7:0", "end_lineno": 397, "node_id": 728}, "end_col_offset": 41, "src": "14930:18:0", "end_lineno": 397, "arg": "new_owner", "node_id": 727}], "lineno": 397, "end_col_offset": 56, "default": null, "src": "14907:873:0", "end_lineno": 418, "node_id": 726}, "lineno": 397, "end_col_offset": 56, "pos": null, "src": "14907:873:0", "decorator_list": [{"ast_type": "Name", "col_offset": 1, "id": "external", "lineno": 396, "end_col_offset": 9, "src": "14898:8:0", "end_lineno": 396, "node_id": 801}], "end_lineno": 418, "node_id": 725, "doc_string": {"ast_type": "DocStr", "col_offset": 4, "value": "\n @dev Transfers the ownership of the contract\n to a new account `new_owner`.\n @notice Note that this function can only be\n called by the current `owner`. Also,\n the `new_owner` cannot be the zero address.\n\n WARNING: The ownership transfer also removes\n the previous owner's minter role and assigns\n the minter role to `new_owner` accordingly.\n @param new_owner The 20-byte address of the new owner.\n ", "lineno": 398, "end_col_offset": 7, "src": "14955:482:0", "end_lineno": 409, "node_id": 803}, "name": "transfer_ownership"}, {"ast_type": "FunctionDef", "col_offset": 0, "returns": null, "body": [{"ast_type": "Expr", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 4, "args": [], "lineno": 438, "end_col_offset": 26, "keywords": [], "src": "16423:22:0", "end_lineno": 438, "func": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "ownable", "lineno": 438, "end_col_offset": 11, "src": "16423:7:0", "end_lineno": 438, "node_id": 811, "type": {"name": "src/snekmate/auth/ownable.vy", "type_decl_node": {"node_id": 0, "source_id": 3}, "typeclass": "module"}}, "lineno": 438, "end_col_offset": 24, "src": "16423:20:0", "end_lineno": 438, "node_id": 810, "attr": "_check_owner", "type": {"name": "_check_owner", "type_decl_node": {"node_id": 106, "source_id": 3}, "typeclass": "contract_function"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 3, "source_id": 3}, "access_path": []}]}, "node_id": 809, "type": {"name": "(void)"}}, "lineno": 438, "end_col_offset": 26, "src": "16423:22:0", "end_lineno": 438, "node_id": 808}, {"target": {"ast_type": "Subscript", "col_offset": 4, "value": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 439, "end_col_offset": 8, "src": "16450:4:0", "end_lineno": 439, "node_id": 817, "type": {"name": "self"}}, "lineno": 439, "end_col_offset": 18, "src": "16450:14:0", "end_lineno": 439, "node_id": 816, "attr": "is_minter", "type": {"key_type": {"name": "address"}, "value_type": {"name": "bool"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "is_minter", "decl_node": {"node_id": 159, "source_id": 0}, "access_path": []}]}, "lineno": 439, "end_col_offset": 30, "src": "16450:26:0", "slice": {"ast_type": "Attribute", "col_offset": 19, "value": {"ast_type": "Name", "col_offset": 19, "id": "msg", "lineno": 439, "end_col_offset": 22, "src": "16465:3:0", "end_lineno": 439, "node_id": 821, "type": {"name": "msg"}}, "lineno": 439, "end_col_offset": 29, "src": "16465:10:0", "end_lineno": 439, "node_id": 820, "attr": "sender", "type": {"name": "address"}}, "end_lineno": 439, "node_id": 815, "type": {"name": "bool"}, "variable_reads": [{"name": "is_minter", "decl_node": {"node_id": 159, "source_id": 0}, "access_path": ["$subscript_access"]}], "variable_writes": [{"name": "is_minter", "decl_node": {"node_id": 159, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "ast_type": "Assign", "col_offset": 4, "value": {"ast_type": "NameConstant", "col_offset": 33, "value": false, "lineno": 439, "end_col_offset": 38, "src": "16479:5:0", "end_lineno": 439, "node_id": 825, "type": {"name": "bool"}}, "lineno": 439, "end_col_offset": 38, "src": "16450:34:0", "end_lineno": 439, "node_id": 814}, {"ast_type": "Log", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 8, "args": [], "lineno": 440, "end_col_offset": 58, "keywords": [{"ast_type": "keyword", "col_offset": 26, "value": {"ast_type": "Attribute", "col_offset": 33, "value": {"ast_type": "Name", "col_offset": 33, "id": "msg", "lineno": 440, "end_col_offset": 36, "src": "16518:3:0", "end_lineno": 440, "node_id": 833, "type": {"name": "msg"}}, "lineno": 440, "end_col_offset": 43, "src": "16518:10:0", "end_lineno": 440, "node_id": 832, "attr": "sender", "type": {"name": "address"}}, "lineno": 440, "end_col_offset": 43, "src": "16511:17:0", "end_lineno": 440, "arg": "minter", "node_id": 831}, {"ast_type": "keyword", "col_offset": 45, "value": {"ast_type": "NameConstant", "col_offset": 52, "value": false, "lineno": 440, "end_col_offset": 57, "src": "16537:5:0", "end_lineno": 440, "node_id": 837, "type": {"name": "bool"}}, "lineno": 440, "end_col_offset": 57, "src": "16530:12:0", "end_lineno": 440, "arg": "status", "node_id": 836}], "src": "16493:50:0", "end_lineno": 440, "func": {"ast_type": "Name", "col_offset": 8, "id": "RoleMinterChanged", "lineno": 440, "end_col_offset": 25, "src": "16493:17:0", "end_lineno": 440, "node_id": 829, "type": {"type_t": {"name": "RoleMinterChanged", "type_decl_node": {"node_id": 191, "source_id": 0}, "typeclass": "event"}}}, "node_id": 828, "type": {"name": "(void)"}}, "lineno": 440, "end_col_offset": 58, "src": "16489:54:0", "end_lineno": 440, "node_id": 827, "type": {"name": "RoleMinterChanged", "type_decl_node": {"node_id": 191, "source_id": 0}, "typeclass": "event"}}, {"ast_type": "Expr", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 4, "args": [{"ast_type": "Call", "col_offset": 32, "args": [{"ast_type": "Name", "col_offset": 38, "id": "address", "lineno": 441, "end_col_offset": 45, "src": "16582:7:0", "end_lineno": 441, "node_id": 847, "type": {"type_t": {"name": "address"}}}], "lineno": 441, "end_col_offset": 46, "keywords": [], "src": "16576:14:0", "end_lineno": 441, "func": {"ast_type": "Name", "col_offset": 32, "id": "empty", "lineno": 441, "end_col_offset": 37, "src": "16576:5:0", "end_lineno": 441, "node_id": 845, "type": {"name": "empty", "typeclass": "builtin_function"}}, "node_id": 844, "type": {"name": "address"}}], "lineno": 441, "end_col_offset": 47, "keywords": [], "src": "16548:43:0", "end_lineno": 441, "func": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "ownable", "lineno": 441, "end_col_offset": 11, "src": "16548:7:0", "end_lineno": 441, "node_id": 841, "type": {"name": "src/snekmate/auth/ownable.vy", "type_decl_node": {"node_id": 0, "source_id": 3}, "typeclass": "module"}}, "lineno": 441, "end_col_offset": 31, "src": "16548:27:0", "end_lineno": 441, "node_id": 840, "attr": "_transfer_ownership", "type": {"name": "_transfer_ownership", "type_decl_node": {"node_id": 125, "source_id": 3}, "typeclass": "contract_function"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 3, "source_id": 3}, "access_path": []}], "variable_writes": [{"name": "owner", "decl_node": {"node_id": 3, "source_id": 3}, "access_path": []}]}, "node_id": 839, "type": {"name": "(void)"}}, "lineno": 441, "end_col_offset": 47, "src": "16548:43:0", "end_lineno": 441, "node_id": 838}], "args": {"ast_type": "arguments", "col_offset": 0, "defaults": [], "args": [], "lineno": 422, "end_col_offset": 47, "default": null, "src": "15793:798:0", "end_lineno": 441, "node_id": 805}, "lineno": 422, "end_col_offset": 47, "pos": null, "src": "15793:798:0", "decorator_list": [{"ast_type": "Name", "col_offset": 1, "id": "external", "lineno": 421, "end_col_offset": 9, "src": "15784:8:0", "end_lineno": 421, "node_id": 849}], "end_lineno": 441, "node_id": 804, "doc_string": {"ast_type": "DocStr", "col_offset": 4, "value": "\n @dev Leaves the contract without an owner.\n @notice Renouncing ownership will leave the\n contract without an owner, thereby\n removing any functionality that is\n only available to the owner. Note\n that the `owner` is also removed from\n the list of allowed minters.\n\n WARNING: All other existing `minter`\n addresses will still be able to create\n new tokens. Consider removing all non-owner\n minter addresses first via `set_minter`\n before calling `renounce_ownership`.\n ", "lineno": 423, "end_col_offset": 7, "src": "15823:595:0", "end_lineno": 437, "node_id": 851}, "name": "renounce_ownership"}, {"ast_type": "FunctionDef", "col_offset": 0, "returns": null, "body": [{"msg": {"ast_type": "Str", "col_offset": 36, "value": "erc20: transfer from the zero address", "lineno": 456, "end_col_offset": 75, "src": "17088:39:0", "end_lineno": 456, "node_id": 875, "type": {"length": 37, "name": "String", "typeclass": "string"}}, "ast_type": "Assert", "col_offset": 4, "lineno": 456, "test": {"op": {"ast_type": "NotEq", "col_offset": 11, "lineno": 342, "end_col_offset": 35, "src": "12657:24:0", "end_lineno": 342, "node_id": 1244}, "ast_type": "Compare", "right": {"ast_type": "Call", "col_offset": 20, "args": [{"ast_type": "Name", "col_offset": 26, "id": "address", "lineno": 456, "end_col_offset": 33, "src": "17078:7:0", "end_lineno": 456, "node_id": 873, "type": {"type_t": {"name": "address"}}}], "lineno": 456, "end_col_offset": 34, "keywords": [], "src": "17072:14:0", "end_lineno": 456, "func": {"ast_type": "Name", "col_offset": 20, "id": "empty", "lineno": 456, "end_col_offset": 25, "src": "17072:5:0", "end_lineno": 456, "node_id": 871, "type": {"name": "empty", "typeclass": "builtin_function"}}, "node_id": 870, "type": {"name": "address"}}, "col_offset": 11, "left": {"ast_type": "Name", "col_offset": 11, "id": "owner", "lineno": 456, "end_col_offset": 16, "src": "17063:5:0", "end_lineno": 456, "node_id": 867, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 854, "source_id": 0}, "access_path": []}]}, "lineno": 456, "end_col_offset": 34, "src": "17063:23:0", "end_lineno": 456, "node_id": 866, "type": {"name": "bool"}}, "end_col_offset": 75, "src": "17056:71:0", "end_lineno": 456, "node_id": 865}, {"msg": {"ast_type": "Str", "col_offset": 33, "value": "erc20: transfer to the zero address", "lineno": 457, "end_col_offset": 70, "src": "17161:37:0", "end_lineno": 457, "node_id": 886, "type": {"length": 35, "name": "String", "typeclass": "string"}}, "ast_type": "Assert", "col_offset": 4, "lineno": 457, "test": {"op": {"ast_type": "NotEq", "col_offset": 11, "lineno": 342, "end_col_offset": 35, "src": "12657:24:0", "end_lineno": 342, "node_id": 1244}, "ast_type": "Compare", "right": {"ast_type": "Call", "col_offset": 17, "args": [{"ast_type": "Name", "col_offset": 23, "id": "address", "lineno": 457, "end_col_offset": 30, "src": "17151:7:0", "end_lineno": 457, "node_id": 884, "type": {"type_t": {"name": "address"}}}], "lineno": 457, "end_col_offset": 31, "keywords": [], "src": "17145:14:0", "end_lineno": 457, "func": {"ast_type": "Name", "col_offset": 17, "id": "empty", "lineno": 457, "end_col_offset": 22, "src": "17145:5:0", "end_lineno": 457, "node_id": 882, "type": {"name": "empty", "typeclass": "builtin_function"}}, "node_id": 881, "type": {"name": "address"}}, "col_offset": 11, "left": {"ast_type": "Name", "col_offset": 11, "id": "to", "lineno": 457, "end_col_offset": 13, "src": "17139:2:0", "end_lineno": 457, "node_id": 878, "type": {"name": "address"}, "variable_reads": [{"name": "to", "decl_node": {"node_id": 857, "source_id": 0}, "access_path": []}]}, "lineno": 457, "end_col_offset": 31, "src": "17139:20:0", "end_lineno": 457, "node_id": 877, "type": {"name": "bool"}}, "end_col_offset": 70, "src": "17132:66:0", "end_lineno": 457, "node_id": 876}, {"ast_type": "Expr", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 4, "args": [{"ast_type": "Name", "col_offset": 32, "id": "owner", "lineno": 459, "end_col_offset": 37, "src": "17232:5:0", "end_lineno": 459, "node_id": 893, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 854, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 39, "id": "to", "lineno": 459, "end_col_offset": 41, "src": "17239:2:0", "end_lineno": 459, "node_id": 895, "type": {"name": "address"}, "variable_reads": [{"name": "to", "decl_node": {"node_id": 857, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 43, "id": "amount", "lineno": 459, "end_col_offset": 49, "src": "17243:6:0", "end_lineno": 459, "node_id": 897, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 860, "source_id": 0}, "access_path": []}]}], "lineno": 459, "end_col_offset": 50, "keywords": [], "src": "17204:46:0", "end_lineno": 459, "func": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 459, "end_col_offset": 8, "src": "17204:4:0", "end_lineno": 459, "node_id": 890, "type": {"name": "self"}}, "lineno": 459, "end_col_offset": 31, "src": "17204:27:0", "end_lineno": 459, "node_id": 889, "attr": "_before_token_transfer", "type": {"name": "_before_token_transfer", "type_decl_node": {"node_id": 1353, "source_id": 0}, "typeclass": "contract_function"}}, "node_id": 888, "type": {"name": "(void)"}}, "lineno": 459, "end_col_offset": 50, "src": "17204:46:0", "end_lineno": 459, "node_id": 887}, {"target": {"ast_type": "Name", "col_offset": 4, "id": "owner_balanceOf", "lineno": 461, "end_col_offset": 19, "src": "17256:15:0", "end_lineno": 461, "node_id": 900, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "owner_balanceOf", "decl_node": {"node_id": 899, "source_id": 0}, "access_path": []}]}, "ast_type": "AnnAssign", "col_offset": 4, "value": {"ast_type": "Subscript", "col_offset": 31, "value": {"ast_type": "Attribute", "col_offset": 31, "value": {"ast_type": "Name", "col_offset": 31, "id": "self", "lineno": 461, "end_col_offset": 35, "src": "17283:4:0", "end_lineno": 461, "node_id": 906, "type": {"name": "self"}}, "lineno": 461, "end_col_offset": 45, "src": "17283:14:0", "end_lineno": 461, "node_id": 905, "attr": "balanceOf", "type": {"key_type": {"name": "address"}, "value_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": []}]}, "lineno": 461, "end_col_offset": 52, "src": "17283:21:0", "slice": {"ast_type": "Name", "col_offset": 46, "id": "owner", "lineno": 461, "end_col_offset": 51, "src": "17298:5:0", "end_lineno": 461, "node_id": 909, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 854, "source_id": 0}, "access_path": []}]}, "end_lineno": 461, "node_id": 904, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "lineno": 461, "annotation": {"ast_type": "Name", "col_offset": 21, "id": "uint256", "lineno": 461, "end_col_offset": 28, "src": "17273:7:0", "end_lineno": 461, "node_id": 902}, "end_col_offset": 52, "src": "17256:48:0", "end_lineno": 461, "node_id": 899}, {"msg": {"ast_type": "Str", "col_offset": 38, "value": "erc20: transfer amount exceeds balance", "lineno": 462, "end_col_offset": 78, "src": "17343:40:0", "end_lineno": 462, "node_id": 919, "type": {"length": 38, "name": "String", "typeclass": "string"}}, "ast_type": "Assert", "col_offset": 4, "lineno": 462, "test": {"op": {"ast_type": "GtE", "col_offset": 11, "lineno": 462, "end_col_offset": 36, "src": "17316:25:0", "end_lineno": 462, "node_id": 1329}, "ast_type": "Compare", "right": {"ast_type": "Name", "col_offset": 30, "id": "amount", "lineno": 462, "end_col_offset": 36, "src": "17335:6:0", "end_lineno": 462, "node_id": 917, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 860, "source_id": 0}, "access_path": []}]}, "col_offset": 11, "left": {"ast_type": "Name", "col_offset": 11, "id": "owner_balanceOf", "lineno": 462, "end_col_offset": 26, "src": "17316:15:0", "end_lineno": 462, "node_id": 914, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "owner_balanceOf", "decl_node": {"node_id": 899, "source_id": 0}, "access_path": []}]}, "lineno": 462, "end_col_offset": 36, "src": "17316:25:0", "end_lineno": 462, "node_id": 913, "type": {"name": "bool"}}, "end_col_offset": 78, "src": "17309:74:0", "end_lineno": 462, "node_id": 912}, {"target": {"ast_type": "Subscript", "col_offset": 4, "value": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 463, "end_col_offset": 8, "src": "17388:4:0", "end_lineno": 463, "node_id": 923, "type": {"name": "self"}}, "lineno": 463, "end_col_offset": 18, "src": "17388:14:0", "end_lineno": 463, "node_id": 922, "attr": "balanceOf", "type": {"key_type": {"name": "address"}, "value_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": []}]}, "lineno": 463, "end_col_offset": 25, "src": "17388:21:0", "slice": {"ast_type": "Name", "col_offset": 19, "id": "owner", "lineno": 463, "end_col_offset": 24, "src": "17403:5:0", "end_lineno": 463, "node_id": 926, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 854, "source_id": 0}, "access_path": []}]}, "end_lineno": 463, "node_id": 921, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": ["$subscript_access"]}], "variable_writes": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "ast_type": "Assign", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 28, "args": [{"ast_type": "Name", "col_offset": 39, "id": "owner_balanceOf", "lineno": 463, "end_col_offset": 54, "src": "17423:15:0", "end_lineno": 463, "node_id": 932, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "owner_balanceOf", "decl_node": {"node_id": 899, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 56, "id": "amount", "lineno": 463, "end_col_offset": 62, "src": "17440:6:0", "end_lineno": 463, "node_id": 934, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 860, "source_id": 0}, "access_path": []}]}], "lineno": 463, "end_col_offset": 63, "keywords": [], "src": "17412:35:0", "end_lineno": 463, "func": {"ast_type": "Name", "col_offset": 28, "id": "unsafe_sub", "lineno": 463, "end_col_offset": 38, "src": "17412:10:0", "end_lineno": 463, "node_id": 930, "type": {"name": "unsafe_sub", "typeclass": "builtin_function"}}, "node_id": 929, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "lineno": 463, "end_col_offset": 63, "src": "17388:59:0", "end_lineno": 463, "node_id": 920}, {"target": {"ast_type": "Subscript", "col_offset": 4, "value": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 464, "end_col_offset": 8, "src": "17452:4:0", "end_lineno": 464, "node_id": 939, "type": {"name": "self"}}, "lineno": 464, "end_col_offset": 18, "src": "17452:14:0", "end_lineno": 464, "node_id": 938, "attr": "balanceOf", "type": {"key_type": {"name": "address"}, "value_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": []}]}, "lineno": 464, "end_col_offset": 22, "src": "17452:18:0", "slice": {"ast_type": "Name", "col_offset": 19, "id": "to", "lineno": 464, "end_col_offset": 21, "src": "17467:2:0", "end_lineno": 464, "node_id": 942, "type": {"name": "address"}, "variable_reads": [{"name": "to", "decl_node": {"node_id": 857, "source_id": 0}, "access_path": []}]}, "end_lineno": 464, "node_id": 937, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": ["$subscript_access"]}], "variable_writes": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "ast_type": "Assign", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 25, "args": [{"ast_type": "Subscript", "col_offset": 36, "value": {"ast_type": "Attribute", "col_offset": 36, "value": {"ast_type": "Name", "col_offset": 36, "id": "self", "lineno": 464, "end_col_offset": 40, "src": "17484:4:0", "end_lineno": 464, "node_id": 950, "type": {"name": "self"}}, "lineno": 464, "end_col_offset": 50, "src": "17484:14:0", "end_lineno": 464, "node_id": 949, "attr": "balanceOf", "type": {"key_type": {"name": "address"}, "value_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": []}]}, "lineno": 464, "end_col_offset": 54, "src": "17484:18:0", "slice": {"ast_type": "Name", "col_offset": 51, "id": "to", "lineno": 464, "end_col_offset": 53, "src": "17499:2:0", "end_lineno": 464, "node_id": 953, "type": {"name": "address"}, "variable_reads": [{"name": "to", "decl_node": {"node_id": 857, "source_id": 0}, "access_path": []}]}, "end_lineno": 464, "node_id": 948, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": ["$subscript_access"]}]}, {"ast_type": "Name", "col_offset": 56, "id": "amount", "lineno": 464, "end_col_offset": 62, "src": "17504:6:0", "end_lineno": 464, "node_id": 956, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 860, "source_id": 0}, "access_path": []}]}], "lineno": 464, "end_col_offset": 63, "keywords": [], "src": "17473:38:0", "end_lineno": 464, "func": {"ast_type": "Name", "col_offset": 25, "id": "unsafe_add", "lineno": 464, "end_col_offset": 35, "src": "17473:10:0", "end_lineno": 464, "node_id": 946, "type": {"name": "unsafe_add", "typeclass": "builtin_function"}}, "node_id": 945, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "lineno": 464, "end_col_offset": 63, "src": "17452:59:0", "end_lineno": 464, "node_id": 936}, {"ast_type": "Log", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 8, "args": [], "lineno": 465, "end_col_offset": 64, "keywords": [{"ast_type": "keyword", "col_offset": 24, "value": {"ast_type": "Name", "col_offset": 31, "id": "owner", "lineno": 465, "end_col_offset": 36, "src": "17543:5:0", "end_lineno": 465, "node_id": 966, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 854, "source_id": 0}, "access_path": []}]}, "lineno": 465, "end_col_offset": 36, "src": "17536:12:0", "end_lineno": 465, "arg": "sender", "node_id": 965}, {"ast_type": "keyword", "col_offset": 38, "value": {"ast_type": "Name", "col_offset": 47, "id": "to", "lineno": 465, "end_col_offset": 49, "src": "17559:2:0", "end_lineno": 465, "node_id": 969, "type": {"name": "address"}, "variable_reads": [{"name": "to", "decl_node": {"node_id": 857, "source_id": 0}, "access_path": []}]}, "lineno": 465, "end_col_offset": 49, "src": "17550:11:0", "end_lineno": 465, "arg": "receiver", "node_id": 968}, {"ast_type": "keyword", "col_offset": 51, "value": {"ast_type": "Name", "col_offset": 57, "id": "amount", "lineno": 465, "end_col_offset": 63, "src": "17569:6:0", "end_lineno": 465, "node_id": 972, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 860, "source_id": 0}, "access_path": []}]}, "lineno": 465, "end_col_offset": 63, "src": "17563:12:0", "end_lineno": 465, "arg": "value", "node_id": 971}], "src": "17520:56:0", "end_lineno": 465, "func": {"ast_type": "Attribute", "col_offset": 8, "value": {"ast_type": "Name", "col_offset": 8, "id": "IERC20", "lineno": 465, "end_col_offset": 14, "src": "17520:6:0", "end_lineno": 465, "node_id": 962, "type": {"type_t": {"name": "/home/user/.local/share/uv/tools/vyper/lib/python3.12/site-packages/vyper/builtins/interfaces/IERC20.vyi", "type_decl_node": {"node_id": 0, "source_id": -2}, "typeclass": "interface"}}}, "lineno": 465, "end_col_offset": 23, "src": "17520:15:0", "end_lineno": 465, "node_id": 961, "attr": "Transfer", "type": {"type_t": {"name": "Transfer", "type_decl_node": {"node_id": 1, "source_id": -2}, "typeclass": "event"}}}, "node_id": 960, "type": {"name": "(void)"}}, "lineno": 465, "end_col_offset": 64, "src": "17516:60:0", "end_lineno": 465, "node_id": 959, "type": {"name": "Transfer", "type_decl_node": {"node_id": 1, "source_id": -2}, "typeclass": "event"}}, {"ast_type": "Expr", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 4, "args": [{"ast_type": "Name", "col_offset": 31, "id": "owner", "lineno": 467, "end_col_offset": 36, "src": "17609:5:0", "end_lineno": 467, "node_id": 980, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 854, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 38, "id": "to", "lineno": 467, "end_col_offset": 40, "src": "17616:2:0", "end_lineno": 467, "node_id": 982, "type": {"name": "address"}, "variable_reads": [{"name": "to", "decl_node": {"node_id": 857, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 42, "id": "amount", "lineno": 467, "end_col_offset": 48, "src": "17620:6:0", "end_lineno": 467, "node_id": 984, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 860, "source_id": 0}, "access_path": []}]}], "lineno": 467, "end_col_offset": 49, "keywords": [], "src": "17582:45:0", "end_lineno": 467, "func": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 467, "end_col_offset": 8, "src": "17582:4:0", "end_lineno": 467, "node_id": 977, "type": {"name": "self"}}, "lineno": 467, "end_col_offset": 30, "src": "17582:26:0", "end_lineno": 467, "node_id": 976, "attr": "_after_token_transfer", "type": {"name": "_after_token_transfer", "type_decl_node": {"node_id": 1370, "source_id": 0}, "typeclass": "contract_function"}}, "node_id": 975, "type": {"name": "(void)"}}, "lineno": 467, "end_col_offset": 49, "src": "17582:45:0", "end_lineno": 467, "node_id": 974}], "args": {"ast_type": "arguments", "col_offset": 0, "defaults": [], "args": [{"ast_type": "arg", "col_offset": 14, "lineno": 445, "annotation": {"ast_type": "Name", "col_offset": 21, "id": "address", "lineno": 445, "end_col_offset": 28, "src": "16625:7:0", "end_lineno": 445, "node_id": 855}, "end_col_offset": 28, "src": "16618:14:0", "end_lineno": 445, "arg": "owner", "node_id": 854}, {"ast_type": "arg", "col_offset": 30, "lineno": 445, "annotation": {"ast_type": "Name", "col_offset": 34, "id": "address", "lineno": 445, "end_col_offset": 41, "src": "16638:7:0", "end_lineno": 445, "node_id": 858}, "end_col_offset": 41, "src": "16634:11:0", "end_lineno": 445, "arg": "to", "node_id": 857}, {"ast_type": "arg", "col_offset": 43, "lineno": 445, "annotation": {"ast_type": "Name", "col_offset": 51, "id": "uint256", "lineno": 445, "end_col_offset": 58, "src": "16655:7:0", "end_lineno": 445, "node_id": 861}, "end_col_offset": 58, "src": "16647:15:0", "end_lineno": 445, "arg": "amount", "node_id": 860}], "lineno": 445, "end_col_offset": 49, "default": null, "src": "16604:1023:0", "end_lineno": 467, "node_id": 853}, "lineno": 445, "end_col_offset": 49, "pos": null, "src": "16604:1023:0", "decorator_list": [{"ast_type": "Name", "col_offset": 1, "id": "internal", "lineno": 444, "end_col_offset": 9, "src": "16595:8:0", "end_lineno": 444, "node_id": 986}], "end_lineno": 467, "node_id": 852, "doc_string": {"ast_type": "DocStr", "col_offset": 4, "value": "\n @dev Moves `amount` tokens from the owner's\n account to `to`.\n @notice Note that `owner` and `to` cannot be\n the zero address. Also, `owner` must\n have a balance of at least `amount`.\n @param owner The 20-byte owner address.\n @param to The 20-byte receiver address.\n @param amount The 32-byte token amount to be transferred.\n ", "lineno": 446, "end_col_offset": 7, "src": "16669:382:0", "end_lineno": 455, "node_id": 988}, "name": "_transfer"}, {"ast_type": "FunctionDef", "col_offset": 0, "returns": null, "body": [{"msg": {"ast_type": "Str", "col_offset": 36, "value": "erc20: mint to the zero address", "lineno": 482, "end_col_offset": 69, "src": "18088:33:0", "end_lineno": 482, "node_id": 1009, "type": {"length": 31, "name": "String", "typeclass": "string"}}, "ast_type": "Assert", "col_offset": 4, "lineno": 482, "test": {"op": {"ast_type": "NotEq", "col_offset": 11, "lineno": 342, "end_col_offset": 35, "src": "12657:24:0", "end_lineno": 342, "node_id": 1244}, "ast_type": "Compare", "right": {"ast_type": "Call", "col_offset": 20, "args": [{"ast_type": "Name", "col_offset": 26, "id": "address", "lineno": 482, "end_col_offset": 33, "src": "18078:7:0", "end_lineno": 482, "node_id": 1007, "type": {"type_t": {"name": "address"}}}], "lineno": 482, "end_col_offset": 34, "keywords": [], "src": "18072:14:0", "end_lineno": 482, "func": {"ast_type": "Name", "col_offset": 20, "id": "empty", "lineno": 482, "end_col_offset": 25, "src": "18072:5:0", "end_lineno": 482, "node_id": 1005, "type": {"name": "empty", "typeclass": "builtin_function"}}, "node_id": 1004, "type": {"name": "address"}}, "col_offset": 11, "left": {"ast_type": "Name", "col_offset": 11, "id": "owner", "lineno": 482, "end_col_offset": 16, "src": "18063:5:0", "end_lineno": 482, "node_id": 1001, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 991, "source_id": 0}, "access_path": []}]}, "lineno": 482, "end_col_offset": 34, "src": "18063:23:0", "end_lineno": 482, "node_id": 1000, "type": {"name": "bool"}}, "end_col_offset": 69, "src": "18056:65:0", "end_lineno": 482, "node_id": 999}, {"ast_type": "Expr", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 4, "args": [{"ast_type": "Call", "col_offset": 32, "args": [{"ast_type": "Name", "col_offset": 38, "id": "address", "lineno": 484, "end_col_offset": 45, "src": "18161:7:0", "end_lineno": 484, "node_id": 1019, "type": {"type_t": {"name": "address"}}}], "lineno": 484, "end_col_offset": 46, "keywords": [], "src": "18155:14:0", "end_lineno": 484, "func": {"ast_type": "Name", "col_offset": 32, "id": "empty", "lineno": 484, "end_col_offset": 37, "src": "18155:5:0", "end_lineno": 484, "node_id": 1017, "type": {"name": "empty", "typeclass": "builtin_function"}}, "node_id": 1016, "type": {"name": "address"}}, {"ast_type": "Name", "col_offset": 48, "id": "owner", "lineno": 484, "end_col_offset": 53, "src": "18171:5:0", "end_lineno": 484, "node_id": 1021, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 991, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 55, "id": "amount", "lineno": 484, "end_col_offset": 61, "src": "18178:6:0", "end_lineno": 484, "node_id": 1023, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 994, "source_id": 0}, "access_path": []}]}], "lineno": 484, "end_col_offset": 62, "keywords": [], "src": "18127:58:0", "end_lineno": 484, "func": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 484, "end_col_offset": 8, "src": "18127:4:0", "end_lineno": 484, "node_id": 1013, "type": {"name": "self"}}, "lineno": 484, "end_col_offset": 31, "src": "18127:27:0", "end_lineno": 484, "node_id": 1012, "attr": "_before_token_transfer", "type": {"name": "_before_token_transfer", "type_decl_node": {"node_id": 1353, "source_id": 0}, "typeclass": "contract_function"}}, "node_id": 1011, "type": {"name": "(void)"}}, "lineno": 484, "end_col_offset": 62, "src": "18127:58:0", "end_lineno": 484, "node_id": 1010}, {"op": {"ast_type": "Add", "col_offset": 4, "lineno": 486, "end_col_offset": 30, "src": "18191:26:0", "end_lineno": 486, "node_id": 1030}, "target": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 486, "end_col_offset": 8, "src": "18191:4:0", "end_lineno": 486, "node_id": 1027, "type": {"name": "self"}}, "lineno": 486, "end_col_offset": 20, "src": "18191:16:0", "end_lineno": 486, "node_id": 1026, "attr": "totalSupply", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "totalSupply", "decl_node": {"node_id": 151, "source_id": 0}, "access_path": []}], "variable_writes": [{"name": "totalSupply", "decl_node": {"node_id": 151, "source_id": 0}, "access_path": []}]}, "ast_type": "AugAssign", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 24, "id": "amount", "lineno": 486, "end_col_offset": 30, "src": "18211:6:0", "end_lineno": 486, "node_id": 1031, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 994, "source_id": 0}, "access_path": []}]}, "lineno": 486, "end_col_offset": 30, "src": "18191:26:0", "end_lineno": 486, "node_id": 1025}, {"target": {"ast_type": "Subscript", "col_offset": 4, "value": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 487, "end_col_offset": 8, "src": "18222:4:0", "end_lineno": 487, "node_id": 1036, "type": {"name": "self"}}, "lineno": 487, "end_col_offset": 18, "src": "18222:14:0", "end_lineno": 487, "node_id": 1035, "attr": "balanceOf", "type": {"key_type": {"name": "address"}, "value_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": []}]}, "lineno": 487, "end_col_offset": 25, "src": "18222:21:0", "slice": {"ast_type": "Name", "col_offset": 19, "id": "owner", "lineno": 487, "end_col_offset": 24, "src": "18237:5:0", "end_lineno": 487, "node_id": 1039, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 991, "source_id": 0}, "access_path": []}]}, "end_lineno": 487, "node_id": 1034, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": ["$subscript_access"]}], "variable_writes": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "ast_type": "Assign", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 28, "args": [{"ast_type": "Subscript", "col_offset": 39, "value": {"ast_type": "Attribute", "col_offset": 39, "value": {"ast_type": "Name", "col_offset": 39, "id": "self", "lineno": 487, "end_col_offset": 43, "src": "18257:4:0", "end_lineno": 487, "node_id": 1047, "type": {"name": "self"}}, "lineno": 487, "end_col_offset": 53, "src": "18257:14:0", "end_lineno": 487, "node_id": 1046, "attr": "balanceOf", "type": {"key_type": {"name": "address"}, "value_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": []}]}, "lineno": 487, "end_col_offset": 60, "src": "18257:21:0", "slice": {"ast_type": "Name", "col_offset": 54, "id": "owner", "lineno": 487, "end_col_offset": 59, "src": "18272:5:0", "end_lineno": 487, "node_id": 1050, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 991, "source_id": 0}, "access_path": []}]}, "end_lineno": 487, "node_id": 1045, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": ["$subscript_access"]}]}, {"ast_type": "Name", "col_offset": 62, "id": "amount", "lineno": 487, "end_col_offset": 68, "src": "18280:6:0", "end_lineno": 487, "node_id": 1053, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 994, "source_id": 0}, "access_path": []}]}], "lineno": 487, "end_col_offset": 69, "keywords": [], "src": "18246:41:0", "end_lineno": 487, "func": {"ast_type": "Name", "col_offset": 28, "id": "unsafe_add", "lineno": 487, "end_col_offset": 38, "src": "18246:10:0", "end_lineno": 487, "node_id": 1043, "type": {"name": "unsafe_add", "typeclass": "builtin_function"}}, "node_id": 1042, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "lineno": 487, "end_col_offset": 69, "src": "18222:65:0", "end_lineno": 487, "node_id": 1033}, {"ast_type": "Log", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 8, "args": [], "lineno": 488, "end_col_offset": 76, "keywords": [{"ast_type": "keyword", "col_offset": 24, "value": {"ast_type": "Call", "col_offset": 31, "args": [{"ast_type": "Name", "col_offset": 37, "id": "address", "lineno": 488, "end_col_offset": 44, "src": "18325:7:0", "end_lineno": 488, "node_id": 1066, "type": {"type_t": {"name": "address"}}}], "lineno": 488, "end_col_offset": 45, "keywords": [], "src": "18319:14:0", "end_lineno": 488, "func": {"ast_type": "Name", "col_offset": 31, "id": "empty", "lineno": 488, "end_col_offset": 36, "src": "18319:5:0", "end_lineno": 488, "node_id": 1064, "type": {"name": "empty", "typeclass": "builtin_function"}}, "node_id": 1063, "type": {"name": "address"}}, "lineno": 488, "end_col_offset": 45, "src": "18312:21:0", "end_lineno": 488, "arg": "sender", "node_id": 1062}, {"ast_type": "keyword", "col_offset": 47, "value": {"ast_type": "Name", "col_offset": 56, "id": "owner", "lineno": 488, "end_col_offset": 61, "src": "18344:5:0", "end_lineno": 488, "node_id": 1069, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 991, "source_id": 0}, "access_path": []}]}, "lineno": 488, "end_col_offset": 61, "src": "18335:14:0", "end_lineno": 488, "arg": "receiver", "node_id": 1068}, {"ast_type": "keyword", "col_offset": 63, "value": {"ast_type": "Name", "col_offset": 69, "id": "amount", "lineno": 488, "end_col_offset": 75, "src": "18357:6:0", "end_lineno": 488, "node_id": 1072, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 994, "source_id": 0}, "access_path": []}]}, "lineno": 488, "end_col_offset": 75, "src": "18351:12:0", "end_lineno": 488, "arg": "value", "node_id": 1071}], "src": "18296:68:0", "end_lineno": 488, "func": {"ast_type": "Attribute", "col_offset": 8, "value": {"ast_type": "Name", "col_offset": 8, "id": "IERC20", "lineno": 488, "end_col_offset": 14, "src": "18296:6:0", "end_lineno": 488, "node_id": 1059, "type": {"type_t": {"name": "/home/user/.local/share/uv/tools/vyper/lib/python3.12/site-packages/vyper/builtins/interfaces/IERC20.vyi", "type_decl_node": {"node_id": 0, "source_id": -2}, "typeclass": "interface"}}}, "lineno": 488, "end_col_offset": 23, "src": "18296:15:0", "end_lineno": 488, "node_id": 1058, "attr": "Transfer", "type": {"type_t": {"name": "Transfer", "type_decl_node": {"node_id": 1, "source_id": -2}, "typeclass": "event"}}}, "node_id": 1057, "type": {"name": "(void)"}}, "lineno": 488, "end_col_offset": 76, "src": "18292:72:0", "end_lineno": 488, "node_id": 1056, "type": {"name": "Transfer", "type_decl_node": {"node_id": 1, "source_id": -2}, "typeclass": "event"}}, {"ast_type": "Expr", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 4, "args": [{"ast_type": "Call", "col_offset": 31, "args": [{"ast_type": "Name", "col_offset": 37, "id": "address", "lineno": 490, "end_col_offset": 44, "src": "18403:7:0", "end_lineno": 490, "node_id": 1083, "type": {"type_t": {"name": "address"}}}], "lineno": 490, "end_col_offset": 45, "keywords": [], "src": "18397:14:0", "end_lineno": 490, "func": {"ast_type": "Name", "col_offset": 31, "id": "empty", "lineno": 490, "end_col_offset": 36, "src": "18397:5:0", "end_lineno": 490, "node_id": 1081, "type": {"name": "empty", "typeclass": "builtin_function"}}, "node_id": 1080, "type": {"name": "address"}}, {"ast_type": "Name", "col_offset": 47, "id": "owner", "lineno": 490, "end_col_offset": 52, "src": "18413:5:0", "end_lineno": 490, "node_id": 1085, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 991, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 54, "id": "amount", "lineno": 490, "end_col_offset": 60, "src": "18420:6:0", "end_lineno": 490, "node_id": 1087, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 994, "source_id": 0}, "access_path": []}]}], "lineno": 490, "end_col_offset": 61, "keywords": [], "src": "18370:57:0", "end_lineno": 490, "func": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 490, "end_col_offset": 8, "src": "18370:4:0", "end_lineno": 490, "node_id": 1077, "type": {"name": "self"}}, "lineno": 490, "end_col_offset": 30, "src": "18370:26:0", "end_lineno": 490, "node_id": 1076, "attr": "_after_token_transfer", "type": {"name": "_after_token_transfer", "type_decl_node": {"node_id": 1370, "source_id": 0}, "typeclass": "contract_function"}}, "node_id": 1075, "type": {"name": "(void)"}}, "lineno": 490, "end_col_offset": 61, "src": "18370:57:0", "end_lineno": 490, "node_id": 1074}], "args": {"ast_type": "arguments", "col_offset": 0, "defaults": [], "args": [{"ast_type": "arg", "col_offset": 10, "lineno": 471, "annotation": {"ast_type": "Name", "col_offset": 17, "id": "address", "lineno": 471, "end_col_offset": 24, "src": "17657:7:0", "end_lineno": 471, "node_id": 992}, "end_col_offset": 24, "src": "17650:14:0", "end_lineno": 471, "arg": "owner", "node_id": 991}, {"ast_type": "arg", "col_offset": 26, "lineno": 471, "annotation": {"ast_type": "Name", "col_offset": 34, "id": "uint256", "lineno": 471, "end_col_offset": 41, "src": "17674:7:0", "end_lineno": 471, "node_id": 995}, "end_col_offset": 41, "src": "17666:15:0", "end_lineno": 471, "arg": "amount", "node_id": 994}], "lineno": 471, "end_col_offset": 61, "default": null, "src": "17640:787:0", "end_lineno": 490, "node_id": 990}, "lineno": 471, "end_col_offset": 61, "pos": null, "src": "17640:787:0", "decorator_list": [{"ast_type": "Name", "col_offset": 1, "id": "internal", "lineno": 470, "end_col_offset": 9, "src": "17631:8:0", "end_lineno": 470, "node_id": 1089}], "end_lineno": 490, "node_id": 989, "doc_string": {"ast_type": "DocStr", "col_offset": 4, "value": "\n @dev Creates `amount` tokens and assigns\n them to `owner`, increasing the\n total supply.\n @notice This is an `internal` function without\n access restriction. Note that `owner`\n cannot be the zero address.\n @param owner The 20-byte owner address.\n @param amount The 32-byte token amount to be created.\n ", "lineno": 472, "end_col_offset": 7, "src": "17688:363:0", "end_lineno": 481, "node_id": 1091}, "name": "_mint"}, {"ast_type": "FunctionDef", "col_offset": 0, "returns": null, "body": [{"msg": {"ast_type": "Str", "col_offset": 36, "value": "erc20: burn from the zero address", "lineno": 504, "end_col_offset": 71, "src": "18856:35:0", "end_lineno": 504, "node_id": 1112, "type": {"length": 33, "name": "String", "typeclass": "string"}}, "ast_type": "Assert", "col_offset": 4, "lineno": 504, "test": {"op": {"ast_type": "NotEq", "col_offset": 11, "lineno": 342, "end_col_offset": 35, "src": "12657:24:0", "end_lineno": 342, "node_id": 1244}, "ast_type": "Compare", "right": {"ast_type": "Call", "col_offset": 20, "args": [{"ast_type": "Name", "col_offset": 26, "id": "address", "lineno": 504, "end_col_offset": 33, "src": "18846:7:0", "end_lineno": 504, "node_id": 1110, "type": {"type_t": {"name": "address"}}}], "lineno": 504, "end_col_offset": 34, "keywords": [], "src": "18840:14:0", "end_lineno": 504, "func": {"ast_type": "Name", "col_offset": 20, "id": "empty", "lineno": 504, "end_col_offset": 25, "src": "18840:5:0", "end_lineno": 504, "node_id": 1108, "type": {"name": "empty", "typeclass": "builtin_function"}}, "node_id": 1107, "type": {"name": "address"}}, "col_offset": 11, "left": {"ast_type": "Name", "col_offset": 11, "id": "owner", "lineno": 504, "end_col_offset": 16, "src": "18831:5:0", "end_lineno": 504, "node_id": 1104, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 1094, "source_id": 0}, "access_path": []}]}, "lineno": 504, "end_col_offset": 34, "src": "18831:23:0", "end_lineno": 504, "node_id": 1103, "type": {"name": "bool"}}, "end_col_offset": 71, "src": "18824:67:0", "end_lineno": 504, "node_id": 1102}, {"ast_type": "Expr", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 4, "args": [{"ast_type": "Name", "col_offset": 32, "id": "owner", "lineno": 506, "end_col_offset": 37, "src": "18925:5:0", "end_lineno": 506, "node_id": 1119, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 1094, "source_id": 0}, "access_path": []}]}, {"ast_type": "Call", "col_offset": 39, "args": [{"ast_type": "Name", "col_offset": 45, "id": "address", "lineno": 506, "end_col_offset": 52, "src": "18938:7:0", "end_lineno": 506, "node_id": 1124, "type": {"type_t": {"name": "address"}}}], "lineno": 506, "end_col_offset": 53, "keywords": [], "src": "18932:14:0", "end_lineno": 506, "func": {"ast_type": "Name", "col_offset": 39, "id": "empty", "lineno": 506, "end_col_offset": 44, "src": "18932:5:0", "end_lineno": 506, "node_id": 1122, "type": {"name": "empty", "typeclass": "builtin_function"}}, "node_id": 1121, "type": {"name": "address"}}, {"ast_type": "Name", "col_offset": 55, "id": "amount", "lineno": 506, "end_col_offset": 61, "src": "18948:6:0", "end_lineno": 506, "node_id": 1126, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 1097, "source_id": 0}, "access_path": []}]}], "lineno": 506, "end_col_offset": 62, "keywords": [], "src": "18897:58:0", "end_lineno": 506, "func": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 506, "end_col_offset": 8, "src": "18897:4:0", "end_lineno": 506, "node_id": 1116, "type": {"name": "self"}}, "lineno": 506, "end_col_offset": 31, "src": "18897:27:0", "end_lineno": 506, "node_id": 1115, "attr": "_before_token_transfer", "type": {"name": "_before_token_transfer", "type_decl_node": {"node_id": 1353, "source_id": 0}, "typeclass": "contract_function"}}, "node_id": 1114, "type": {"name": "(void)"}}, "lineno": 506, "end_col_offset": 62, "src": "18897:58:0", "end_lineno": 506, "node_id": 1113}, {"target": {"ast_type": "Name", "col_offset": 4, "id": "account_balance", "lineno": 508, "end_col_offset": 19, "src": "18961:15:0", "end_lineno": 508, "node_id": 1129, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "account_balance", "decl_node": {"node_id": 1128, "source_id": 0}, "access_path": []}]}, "ast_type": "AnnAssign", "col_offset": 4, "value": {"ast_type": "Subscript", "col_offset": 31, "value": {"ast_type": "Attribute", "col_offset": 31, "value": {"ast_type": "Name", "col_offset": 31, "id": "self", "lineno": 508, "end_col_offset": 35, "src": "18988:4:0", "end_lineno": 508, "node_id": 1135, "type": {"name": "self"}}, "lineno": 508, "end_col_offset": 45, "src": "18988:14:0", "end_lineno": 508, "node_id": 1134, "attr": "balanceOf", "type": {"key_type": {"name": "address"}, "value_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": []}]}, "lineno": 508, "end_col_offset": 52, "src": "18988:21:0", "slice": {"ast_type": "Name", "col_offset": 46, "id": "owner", "lineno": 508, "end_col_offset": 51, "src": "19003:5:0", "end_lineno": 508, "node_id": 1138, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 1094, "source_id": 0}, "access_path": []}]}, "end_lineno": 508, "node_id": 1133, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "lineno": 508, "annotation": {"ast_type": "Name", "col_offset": 21, "id": "uint256", "lineno": 508, "end_col_offset": 28, "src": "18978:7:0", "end_lineno": 508, "node_id": 1131}, "end_col_offset": 52, "src": "18961:48:0", "end_lineno": 508, "node_id": 1128}, {"msg": {"ast_type": "Str", "col_offset": 38, "value": "erc20: burn amount exceeds balance", "lineno": 509, "end_col_offset": 74, "src": "19048:36:0", "end_lineno": 509, "node_id": 1148, "type": {"length": 34, "name": "String", "typeclass": "string"}}, "ast_type": "Assert", "col_offset": 4, "lineno": 509, "test": {"op": {"ast_type": "GtE", "col_offset": 11, "lineno": 462, "end_col_offset": 36, "src": "17316:25:0", "end_lineno": 462, "node_id": 1329}, "ast_type": "Compare", "right": {"ast_type": "Name", "col_offset": 30, "id": "amount", "lineno": 509, "end_col_offset": 36, "src": "19040:6:0", "end_lineno": 509, "node_id": 1146, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 1097, "source_id": 0}, "access_path": []}]}, "col_offset": 11, "left": {"ast_type": "Name", "col_offset": 11, "id": "account_balance", "lineno": 509, "end_col_offset": 26, "src": "19021:15:0", "end_lineno": 509, "node_id": 1143, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "account_balance", "decl_node": {"node_id": 1128, "source_id": 0}, "access_path": []}]}, "lineno": 509, "end_col_offset": 36, "src": "19021:25:0", "end_lineno": 509, "node_id": 1142, "type": {"name": "bool"}}, "end_col_offset": 74, "src": "19014:70:0", "end_lineno": 509, "node_id": 1141}, {"target": {"ast_type": "Subscript", "col_offset": 4, "value": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 510, "end_col_offset": 8, "src": "19089:4:0", "end_lineno": 510, "node_id": 1152, "type": {"name": "self"}}, "lineno": 510, "end_col_offset": 18, "src": "19089:14:0", "end_lineno": 510, "node_id": 1151, "attr": "balanceOf", "type": {"key_type": {"name": "address"}, "value_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": []}]}, "lineno": 510, "end_col_offset": 25, "src": "19089:21:0", "slice": {"ast_type": "Name", "col_offset": 19, "id": "owner", "lineno": 510, "end_col_offset": 24, "src": "19104:5:0", "end_lineno": 510, "node_id": 1155, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 1094, "source_id": 0}, "access_path": []}]}, "end_lineno": 510, "node_id": 1150, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": ["$subscript_access"]}], "variable_writes": [{"name": "balanceOf", "decl_node": {"node_id": 111, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "ast_type": "Assign", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 28, "args": [{"ast_type": "Name", "col_offset": 39, "id": "account_balance", "lineno": 510, "end_col_offset": 54, "src": "19124:15:0", "end_lineno": 510, "node_id": 1161, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "account_balance", "decl_node": {"node_id": 1128, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 56, "id": "amount", "lineno": 510, "end_col_offset": 62, "src": "19141:6:0", "end_lineno": 510, "node_id": 1163, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 1097, "source_id": 0}, "access_path": []}]}], "lineno": 510, "end_col_offset": 63, "keywords": [], "src": "19113:35:0", "end_lineno": 510, "func": {"ast_type": "Name", "col_offset": 28, "id": "unsafe_sub", "lineno": 510, "end_col_offset": 38, "src": "19113:10:0", "end_lineno": 510, "node_id": 1159, "type": {"name": "unsafe_sub", "typeclass": "builtin_function"}}, "node_id": 1158, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "lineno": 510, "end_col_offset": 63, "src": "19089:59:0", "end_lineno": 510, "node_id": 1149}, {"target": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 511, "end_col_offset": 8, "src": "19153:4:0", "end_lineno": 511, "node_id": 1167, "type": {"name": "self"}}, "lineno": 511, "end_col_offset": 20, "src": "19153:16:0", "end_lineno": 511, "node_id": 1166, "attr": "totalSupply", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "totalSupply", "decl_node": {"node_id": 151, "source_id": 0}, "access_path": []}], "variable_writes": [{"name": "totalSupply", "decl_node": {"node_id": 151, "source_id": 0}, "access_path": []}]}, "ast_type": "Assign", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 23, "args": [{"ast_type": "Attribute", "col_offset": 34, "value": {"ast_type": "Name", "col_offset": 34, "id": "self", "lineno": 511, "end_col_offset": 38, "src": "19183:4:0", "end_lineno": 511, "node_id": 1174, "type": {"name": "self"}}, "lineno": 511, "end_col_offset": 50, "src": "19183:16:0", "end_lineno": 511, "node_id": 1173, "attr": "totalSupply", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "totalSupply", "decl_node": {"node_id": 151, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 52, "id": "amount", "lineno": 511, "end_col_offset": 58, "src": "19201:6:0", "end_lineno": 511, "node_id": 1177, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 1097, "source_id": 0}, "access_path": []}]}], "lineno": 511, "end_col_offset": 59, "keywords": [], "src": "19172:36:0", "end_lineno": 511, "func": {"ast_type": "Name", "col_offset": 23, "id": "unsafe_sub", "lineno": 511, "end_col_offset": 33, "src": "19172:10:0", "end_lineno": 511, "node_id": 1171, "type": {"name": "unsafe_sub", "typeclass": "builtin_function"}}, "node_id": 1170, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "lineno": 511, "end_col_offset": 59, "src": "19153:55:0", "end_lineno": 511, "node_id": 1165}, {"ast_type": "Log", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 8, "args": [], "lineno": 512, "end_col_offset": 76, "keywords": [{"ast_type": "keyword", "col_offset": 24, "value": {"ast_type": "Name", "col_offset": 31, "id": "owner", "lineno": 512, "end_col_offset": 36, "src": "19240:5:0", "end_lineno": 512, "node_id": 1187, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 1094, "source_id": 0}, "access_path": []}]}, "lineno": 512, "end_col_offset": 36, "src": "19233:12:0", "end_lineno": 512, "arg": "sender", "node_id": 1186}, {"ast_type": "keyword", "col_offset": 38, "value": {"ast_type": "Call", "col_offset": 47, "args": [{"ast_type": "Name", "col_offset": 53, "id": "address", "lineno": 512, "end_col_offset": 60, "src": "19262:7:0", "end_lineno": 512, "node_id": 1193, "type": {"type_t": {"name": "address"}}}], "lineno": 512, "end_col_offset": 61, "keywords": [], "src": "19256:14:0", "end_lineno": 512, "func": {"ast_type": "Name", "col_offset": 47, "id": "empty", "lineno": 512, "end_col_offset": 52, "src": "19256:5:0", "end_lineno": 512, "node_id": 1191, "type": {"name": "empty", "typeclass": "builtin_function"}}, "node_id": 1190, "type": {"name": "address"}}, "lineno": 512, "end_col_offset": 61, "src": "19247:23:0", "end_lineno": 512, "arg": "receiver", "node_id": 1189}, {"ast_type": "keyword", "col_offset": 63, "value": {"ast_type": "Name", "col_offset": 69, "id": "amount", "lineno": 512, "end_col_offset": 75, "src": "19278:6:0", "end_lineno": 512, "node_id": 1196, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 1097, "source_id": 0}, "access_path": []}]}, "lineno": 512, "end_col_offset": 75, "src": "19272:12:0", "end_lineno": 512, "arg": "value", "node_id": 1195}], "src": "19217:68:0", "end_lineno": 512, "func": {"ast_type": "Attribute", "col_offset": 8, "value": {"ast_type": "Name", "col_offset": 8, "id": "IERC20", "lineno": 512, "end_col_offset": 14, "src": "19217:6:0", "end_lineno": 512, "node_id": 1183, "type": {"type_t": {"name": "/home/user/.local/share/uv/tools/vyper/lib/python3.12/site-packages/vyper/builtins/interfaces/IERC20.vyi", "type_decl_node": {"node_id": 0, "source_id": -2}, "typeclass": "interface"}}}, "lineno": 512, "end_col_offset": 23, "src": "19217:15:0", "end_lineno": 512, "node_id": 1182, "attr": "Transfer", "type": {"type_t": {"name": "Transfer", "type_decl_node": {"node_id": 1, "source_id": -2}, "typeclass": "event"}}}, "node_id": 1181, "type": {"name": "(void)"}}, "lineno": 512, "end_col_offset": 76, "src": "19213:72:0", "end_lineno": 512, "node_id": 1180, "type": {"name": "Transfer", "type_decl_node": {"node_id": 1, "source_id": -2}, "typeclass": "event"}}, {"ast_type": "Expr", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 4, "args": [{"ast_type": "Name", "col_offset": 31, "id": "owner", "lineno": 514, "end_col_offset": 36, "src": "19318:5:0", "end_lineno": 514, "node_id": 1204, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 1094, "source_id": 0}, "access_path": []}]}, {"ast_type": "Call", "col_offset": 38, "args": [{"ast_type": "Name", "col_offset": 44, "id": "address", "lineno": 514, "end_col_offset": 51, "src": "19331:7:0", "end_lineno": 514, "node_id": 1209, "type": {"type_t": {"name": "address"}}}], "lineno": 514, "end_col_offset": 52, "keywords": [], "src": "19325:14:0", "end_lineno": 514, "func": {"ast_type": "Name", "col_offset": 38, "id": "empty", "lineno": 514, "end_col_offset": 43, "src": "19325:5:0", "end_lineno": 514, "node_id": 1207, "type": {"name": "empty", "typeclass": "builtin_function"}}, "node_id": 1206, "type": {"name": "address"}}, {"ast_type": "Name", "col_offset": 54, "id": "amount", "lineno": 514, "end_col_offset": 60, "src": "19341:6:0", "end_lineno": 514, "node_id": 1211, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 1097, "source_id": 0}, "access_path": []}]}], "lineno": 514, "end_col_offset": 61, "keywords": [], "src": "19291:57:0", "end_lineno": 514, "func": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 514, "end_col_offset": 8, "src": "19291:4:0", "end_lineno": 514, "node_id": 1201, "type": {"name": "self"}}, "lineno": 514, "end_col_offset": 30, "src": "19291:26:0", "end_lineno": 514, "node_id": 1200, "attr": "_after_token_transfer", "type": {"name": "_after_token_transfer", "type_decl_node": {"node_id": 1370, "source_id": 0}, "typeclass": "contract_function"}}, "node_id": 1199, "type": {"name": "(void)"}}, "lineno": 514, "end_col_offset": 61, "src": "19291:57:0", "end_lineno": 514, "node_id": 1198}], "args": {"ast_type": "arguments", "col_offset": 0, "defaults": [], "args": [{"ast_type": "arg", "col_offset": 10, "lineno": 494, "annotation": {"ast_type": "Name", "col_offset": 17, "id": "address", "lineno": 494, "end_col_offset": 24, "src": "18457:7:0", "end_lineno": 494, "node_id": 1095}, "end_col_offset": 24, "src": "18450:14:0", "end_lineno": 494, "arg": "owner", "node_id": 1094}, {"ast_type": "arg", "col_offset": 26, "lineno": 494, "annotation": {"ast_type": "Name", "col_offset": 34, "id": "uint256", "lineno": 494, "end_col_offset": 41, "src": "18474:7:0", "end_lineno": 494, "node_id": 1098}, "end_col_offset": 41, "src": "18466:15:0", "end_lineno": 494, "arg": "amount", "node_id": 1097}], "lineno": 494, "end_col_offset": 61, "default": null, "src": "18440:908:0", "end_lineno": 514, "node_id": 1093}, "lineno": 494, "end_col_offset": 61, "pos": null, "src": "18440:908:0", "decorator_list": [{"ast_type": "Name", "col_offset": 1, "id": "internal", "lineno": 493, "end_col_offset": 9, "src": "18431:8:0", "end_lineno": 493, "node_id": 1213}], "end_lineno": 514, "node_id": 1092, "doc_string": {"ast_type": "DocStr", "col_offset": 4, "value": "\n @dev Destroys `amount` tokens from `owner`,\n reducing the total supply.\n @notice Note that `owner` cannot be the\n zero address. Also, `owner` must\n have at least `amount` tokens.\n @param owner The 20-byte owner address.\n @param amount The 32-byte token amount to be destroyed.\n ", "lineno": 495, "end_col_offset": 7, "src": "18488:331:0", "end_lineno": 503, "node_id": 1215}, "name": "_burn"}, {"ast_type": "FunctionDef", "col_offset": 0, "returns": null, "body": [{"msg": {"ast_type": "Str", "col_offset": 36, "value": "erc20: approve from the zero address", "lineno": 529, "end_col_offset": 74, "src": "19843:38:0", "end_lineno": 529, "node_id": 1239, "type": {"length": 36, "name": "String", "typeclass": "string"}}, "ast_type": "Assert", "col_offset": 4, "lineno": 529, "test": {"op": {"ast_type": "NotEq", "col_offset": 11, "lineno": 342, "end_col_offset": 35, "src": "12657:24:0", "end_lineno": 342, "node_id": 1244}, "ast_type": "Compare", "right": {"ast_type": "Call", "col_offset": 20, "args": [{"ast_type": "Name", "col_offset": 26, "id": "address", "lineno": 529, "end_col_offset": 33, "src": "19833:7:0", "end_lineno": 529, "node_id": 1237, "type": {"type_t": {"name": "address"}}}], "lineno": 529, "end_col_offset": 34, "keywords": [], "src": "19827:14:0", "end_lineno": 529, "func": {"ast_type": "Name", "col_offset": 20, "id": "empty", "lineno": 529, "end_col_offset": 25, "src": "19827:5:0", "end_lineno": 529, "node_id": 1235, "type": {"name": "empty", "typeclass": "builtin_function"}}, "node_id": 1234, "type": {"name": "address"}}, "col_offset": 11, "left": {"ast_type": "Name", "col_offset": 11, "id": "owner", "lineno": 529, "end_col_offset": 16, "src": "19818:5:0", "end_lineno": 529, "node_id": 1231, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 1218, "source_id": 0}, "access_path": []}]}, "lineno": 529, "end_col_offset": 34, "src": "19818:23:0", "end_lineno": 529, "node_id": 1230, "type": {"name": "bool"}}, "end_col_offset": 74, "src": "19811:70:0", "end_lineno": 529, "node_id": 1229}, {"msg": {"ast_type": "Str", "col_offset": 38, "value": "erc20: approve to the zero address", "lineno": 530, "end_col_offset": 74, "src": "19920:36:0", "end_lineno": 530, "node_id": 1250, "type": {"length": 34, "name": "String", "typeclass": "string"}}, "ast_type": "Assert", "col_offset": 4, "lineno": 530, "test": {"op": {"ast_type": "NotEq", "col_offset": 11, "lineno": 342, "end_col_offset": 35, "src": "12657:24:0", "end_lineno": 342, "node_id": 1244}, "ast_type": "Compare", "right": {"ast_type": "Call", "col_offset": 22, "args": [{"ast_type": "Name", "col_offset": 28, "id": "address", "lineno": 530, "end_col_offset": 35, "src": "19910:7:0", "end_lineno": 530, "node_id": 1248, "type": {"type_t": {"name": "address"}}}], "lineno": 530, "end_col_offset": 36, "keywords": [], "src": "19904:14:0", "end_lineno": 530, "func": {"ast_type": "Name", "col_offset": 22, "id": "empty", "lineno": 530, "end_col_offset": 27, "src": "19904:5:0", "end_lineno": 530, "node_id": 1246, "type": {"name": "empty", "typeclass": "builtin_function"}}, "node_id": 1245, "type": {"name": "address"}}, "col_offset": 11, "left": {"ast_type": "Name", "col_offset": 11, "id": "spender", "lineno": 530, "end_col_offset": 18, "src": "19893:7:0", "end_lineno": 530, "node_id": 1242, "type": {"name": "address"}, "variable_reads": [{"name": "spender", "decl_node": {"node_id": 1221, "source_id": 0}, "access_path": []}]}, "lineno": 530, "end_col_offset": 36, "src": "19893:25:0", "end_lineno": 530, "node_id": 1241, "type": {"name": "bool"}}, "end_col_offset": 74, "src": "19886:70:0", "end_lineno": 530, "node_id": 1240}, {"target": {"ast_type": "Subscript", "col_offset": 4, "value": {"ast_type": "Subscript", "col_offset": 4, "value": {"ast_type": "Attribute", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 4, "id": "self", "lineno": 532, "end_col_offset": 8, "src": "19962:4:0", "end_lineno": 532, "node_id": 1255, "type": {"name": "self"}}, "lineno": 532, "end_col_offset": 18, "src": "19962:14:0", "end_lineno": 532, "node_id": 1254, "attr": "allowance", "type": {"key_type": {"name": "address"}, "value_type": {"key_type": {"name": "address"}, "value_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "name": "HashMap", "typeclass": "hashmap"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": []}]}, "lineno": 532, "end_col_offset": 25, "src": "19962:21:0", "slice": {"ast_type": "Name", "col_offset": 19, "id": "owner", "lineno": 532, "end_col_offset": 24, "src": "19977:5:0", "end_lineno": 532, "node_id": 1258, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 1218, "source_id": 0}, "access_path": []}]}, "end_lineno": 532, "node_id": 1253, "type": {"key_type": {"name": "address"}, "value_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "lineno": 532, "end_col_offset": 34, "src": "19962:30:0", "slice": {"ast_type": "Name", "col_offset": 26, "id": "spender", "lineno": 532, "end_col_offset": 33, "src": "19984:7:0", "end_lineno": 532, "node_id": 1261, "type": {"name": "address"}, "variable_reads": [{"name": "spender", "decl_node": {"node_id": 1221, "source_id": 0}, "access_path": []}]}, "end_lineno": 532, "node_id": 1252, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}], "variable_writes": [{"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}]}, "ast_type": "Assign", "col_offset": 4, "value": {"ast_type": "Name", "col_offset": 37, "id": "amount", "lineno": 532, "end_col_offset": 43, "src": "19995:6:0", "end_lineno": 532, "node_id": 1264, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 1224, "source_id": 0}, "access_path": []}]}, "lineno": 532, "end_col_offset": 43, "src": "19962:39:0", "end_lineno": 532, "node_id": 1251}, {"ast_type": "Log", "col_offset": 4, "value": {"ast_type": "Call", "col_offset": 8, "args": [], "lineno": 533, "end_col_offset": 67, "keywords": [{"ast_type": "keyword", "col_offset": 24, "value": {"ast_type": "Name", "col_offset": 30, "id": "owner", "lineno": 533, "end_col_offset": 35, "src": "20032:5:0", "end_lineno": 533, "node_id": 1274, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 1218, "source_id": 0}, "access_path": []}]}, "lineno": 533, "end_col_offset": 35, "src": "20026:11:0", "end_lineno": 533, "arg": "owner", "node_id": 1273}, {"ast_type": "keyword", "col_offset": 37, "value": {"ast_type": "Name", "col_offset": 45, "id": "spender", "lineno": 533, "end_col_offset": 52, "src": "20047:7:0", "end_lineno": 533, "node_id": 1277, "type": {"name": "address"}, "variable_reads": [{"name": "spender", "decl_node": {"node_id": 1221, "source_id": 0}, "access_path": []}]}, "lineno": 533, "end_col_offset": 52, "src": "20039:15:0", "end_lineno": 533, "arg": "spender", "node_id": 1276}, {"ast_type": "keyword", "col_offset": 54, "value": {"ast_type": "Name", "col_offset": 60, "id": "amount", "lineno": 533, "end_col_offset": 66, "src": "20062:6:0", "end_lineno": 533, "node_id": 1280, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 1224, "source_id": 0}, "access_path": []}]}, "lineno": 533, "end_col_offset": 66, "src": "20056:12:0", "end_lineno": 533, "arg": "value", "node_id": 1279}], "src": "20010:59:0", "end_lineno": 533, "func": {"ast_type": "Attribute", "col_offset": 8, "value": {"ast_type": "Name", "col_offset": 8, "id": "IERC20", "lineno": 533, "end_col_offset": 14, "src": "20010:6:0", "end_lineno": 533, "node_id": 1270, "type": {"type_t": {"name": "/home/user/.local/share/uv/tools/vyper/lib/python3.12/site-packages/vyper/builtins/interfaces/IERC20.vyi", "type_decl_node": {"node_id": 0, "source_id": -2}, "typeclass": "interface"}}}, "lineno": 533, "end_col_offset": 23, "src": "20010:15:0", "end_lineno": 533, "node_id": 1269, "attr": "Approval", "type": {"type_t": {"name": "Approval", "type_decl_node": {"node_id": 23, "source_id": -2}, "typeclass": "event"}}}, "node_id": 1268, "type": {"name": "(void)"}}, "lineno": 533, "end_col_offset": 67, "src": "20006:63:0", "end_lineno": 533, "node_id": 1267, "type": {"name": "Approval", "type_decl_node": {"node_id": 23, "source_id": -2}, "typeclass": "event"}}], "args": {"ast_type": "arguments", "col_offset": 0, "defaults": [], "args": [{"ast_type": "arg", "col_offset": 13, "lineno": 518, "annotation": {"ast_type": "Name", "col_offset": 20, "id": "address", "lineno": 518, "end_col_offset": 27, "src": "19381:7:0", "end_lineno": 518, "node_id": 1219}, "end_col_offset": 27, "src": "19374:14:0", "end_lineno": 518, "arg": "owner", "node_id": 1218}, {"ast_type": "arg", "col_offset": 29, "lineno": 518, "annotation": {"ast_type": "Name", "col_offset": 38, "id": "address", "lineno": 518, "end_col_offset": 45, "src": "19399:7:0", "end_lineno": 518, "node_id": 1222}, "end_col_offset": 45, "src": "19390:16:0", "end_lineno": 518, "arg": "spender", "node_id": 1221}, {"ast_type": "arg", "col_offset": 47, "lineno": 518, "annotation": {"ast_type": "Name", "col_offset": 55, "id": "uint256", "lineno": 518, "end_col_offset": 62, "src": "19416:7:0", "end_lineno": 518, "node_id": 1225}, "end_col_offset": 62, "src": "19408:15:0", "end_lineno": 518, "arg": "amount", "node_id": 1224}], "lineno": 518, "end_col_offset": 67, "default": null, "src": "19361:708:0", "end_lineno": 533, "node_id": 1217}, "lineno": 518, "end_col_offset": 67, "pos": null, "src": "19361:708:0", "decorator_list": [{"ast_type": "Name", "col_offset": 1, "id": "internal", "lineno": 517, "end_col_offset": 9, "src": "19352:8:0", "end_lineno": 517, "node_id": 1282}], "end_lineno": 533, "node_id": 1216, "doc_string": {"ast_type": "DocStr", "col_offset": 4, "value": "\n @dev Sets `amount` as the allowance of `spender`\n over the `owner`'s tokens.\n @notice Note that `owner` and `spender` cannot\n be the zero address.\n @param owner The 20-byte owner address.\n @param spender The 20-byte spender address.\n @param amount The 32-byte token amount that is\n allowed to be spent by the `spender`.\n ", "lineno": 519, "end_col_offset": 7, "src": "19430:376:0", "end_lineno": 528, "node_id": 1284}, "name": "_approve"}, {"ast_type": "FunctionDef", "col_offset": 0, "returns": null, "body": [{"target": {"ast_type": "Name", "col_offset": 4, "id": "current_allowance", "lineno": 550, "end_col_offset": 21, "src": "20647:17:0", "end_lineno": 550, "node_id": 1299, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "current_allowance", "decl_node": {"node_id": 1298, "source_id": 0}, "access_path": []}]}, "ast_type": "AnnAssign", "col_offset": 4, "value": {"ast_type": "Subscript", "col_offset": 33, "value": {"ast_type": "Subscript", "col_offset": 33, "value": {"ast_type": "Attribute", "col_offset": 33, "value": {"ast_type": "Name", "col_offset": 33, "id": "self", "lineno": 550, "end_col_offset": 37, "src": "20676:4:0", "end_lineno": 550, "node_id": 1306, "type": {"name": "self"}}, "lineno": 550, "end_col_offset": 47, "src": "20676:14:0", "end_lineno": 550, "node_id": 1305, "attr": "allowance", "type": {"key_type": {"name": "address"}, "value_type": {"key_type": {"name": "address"}, "value_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "name": "HashMap", "typeclass": "hashmap"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": []}]}, "lineno": 550, "end_col_offset": 54, "src": "20676:21:0", "slice": {"ast_type": "Name", "col_offset": 48, "id": "owner", "lineno": 550, "end_col_offset": 53, "src": "20691:5:0", "end_lineno": 550, "node_id": 1309, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 1287, "source_id": 0}, "access_path": []}]}, "end_lineno": 550, "node_id": 1304, "type": {"key_type": {"name": "address"}, "value_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "name": "HashMap", "typeclass": "hashmap"}, "variable_reads": [{"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": ["$subscript_access"]}]}, "lineno": 550, "end_col_offset": 63, "src": "20676:30:0", "slice": {"ast_type": "Name", "col_offset": 55, "id": "spender", "lineno": 550, "end_col_offset": 62, "src": "20698:7:0", "end_lineno": 550, "node_id": 1312, "type": {"name": "address"}, "variable_reads": [{"name": "spender", "decl_node": {"node_id": 1290, "source_id": 0}, "access_path": []}]}, "end_lineno": 550, "node_id": 1303, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}]}, "lineno": 550, "annotation": {"ast_type": "Name", "col_offset": 23, "id": "uint256", "lineno": 550, "end_col_offset": 30, "src": "20666:7:0", "end_lineno": 550, "node_id": 1301}, "end_col_offset": 63, "src": "20647:59:0", "end_lineno": 550, "node_id": 1298}, {"ast_type": "If", "col_offset": 4, "orelse": [], "body": [{"msg": {"ast_type": "Str", "col_offset": 44, "value": "erc20: insufficient allowance", "lineno": 558, "end_col_offset": 75, "src": "21157:31:0", "end_lineno": 558, "node_id": 1332, "type": {"length": 29, "name": "String", "typeclass": "string"}}, "ast_type": "Assert", "col_offset": 8, "lineno": 558, "test": {"op": {"ast_type": "GtE", "col_offset": 11, "lineno": 462, "end_col_offset": 36, "src": "17316:25:0", "end_lineno": 462, "node_id": 1329}, "ast_type": "Compare", "right": {"ast_type": "Name", "col_offset": 36, "id": "amount", "lineno": 558, "end_col_offset": 42, "src": "21149:6:0", "end_lineno": 558, "node_id": 1330, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 1293, "source_id": 0}, "access_path": []}]}, "col_offset": 15, "left": {"ast_type": "Name", "col_offset": 15, "id": "current_allowance", "lineno": 558, "end_col_offset": 32, "src": "21128:17:0", "end_lineno": 558, "node_id": 1327, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "current_allowance", "decl_node": {"node_id": 1298, "source_id": 0}, "access_path": []}]}, "lineno": 558, "end_col_offset": 42, "src": "21128:27:0", "end_lineno": 558, "node_id": 1326, "type": {"name": "bool"}}, "end_col_offset": 75, "src": "21121:67:0", "end_lineno": 558, "node_id": 1325}, {"ast_type": "Expr", "col_offset": 8, "value": {"ast_type": "Call", "col_offset": 8, "args": [{"ast_type": "Name", "col_offset": 22, "id": "owner", "lineno": 559, "end_col_offset": 27, "src": "21211:5:0", "end_lineno": 559, "node_id": 1339, "type": {"name": "address"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 1287, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 29, "id": "spender", "lineno": 559, "end_col_offset": 36, "src": "21218:7:0", "end_lineno": 559, "node_id": 1341, "type": {"name": "address"}, "variable_reads": [{"name": "spender", "decl_node": {"node_id": 1290, "source_id": 0}, "access_path": []}]}, {"ast_type": "Call", "col_offset": 38, "args": [{"ast_type": "Name", "col_offset": 49, "id": "current_allowance", "lineno": 559, "end_col_offset": 66, "src": "21238:17:0", "end_lineno": 559, "node_id": 1346, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "current_allowance", "decl_node": {"node_id": 1298, "source_id": 0}, "access_path": []}]}, {"ast_type": "Name", "col_offset": 68, "id": "amount", "lineno": 559, "end_col_offset": 74, "src": "21257:6:0", "end_lineno": 559, "node_id": 1348, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "amount", "decl_node": {"node_id": 1293, "source_id": 0}, "access_path": []}]}], "lineno": 559, "end_col_offset": 75, "keywords": [], "src": "21227:37:0", "end_lineno": 559, "func": {"ast_type": "Name", "col_offset": 38, "id": "unsafe_sub", "lineno": 559, "end_col_offset": 48, "src": "21227:10:0", "end_lineno": 559, "node_id": 1344, "type": {"name": "unsafe_sub", "typeclass": "builtin_function"}}, "node_id": 1343, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}], "lineno": 559, "end_col_offset": 76, "keywords": [], "src": "21197:68:0", "end_lineno": 559, "func": {"ast_type": "Attribute", "col_offset": 8, "value": {"ast_type": "Name", "col_offset": 8, "id": "self", "lineno": 559, "end_col_offset": 12, "src": "21197:4:0", "end_lineno": 559, "node_id": 1336, "type": {"name": "self"}}, "lineno": 559, "end_col_offset": 21, "src": "21197:13:0", "end_lineno": 559, "node_id": 1335, "attr": "_approve", "type": {"name": "_approve", "type_decl_node": {"node_id": 1216, "source_id": 0}, "typeclass": "contract_function"}, "variable_reads": [{"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": []}, {"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": ["$subscript_access"]}, {"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}], "variable_writes": [{"name": "allowance", "decl_node": {"node_id": 127, "source_id": 0}, "access_path": ["$subscript_access", "$subscript_access"]}]}, "node_id": 1334, "type": {"name": "(void)"}}, "lineno": 559, "end_col_offset": 76, "src": "21197:68:0", "end_lineno": 559, "node_id": 1333}], "test": {"op": {"ast_type": "Lt", "col_offset": 7, "lineno": 551, "end_col_offset": 45, "src": "20714:38:0", "end_lineno": 551, "node_id": 1319}, "ast_type": "Compare", "right": {"ast_type": "Call", "col_offset": 27, "args": [{"ast_type": "Name", "col_offset": 37, "id": "uint256", "lineno": 551, "end_col_offset": 44, "src": "20744:7:0", "end_lineno": 551, "node_id": 1323, "type": {"type_t": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}}], "lineno": 551, "end_col_offset": 45, "keywords": [], "src": "20734:18:0", "end_lineno": 551, "func": {"ast_type": "Name", "col_offset": 27, "id": "max_value", "lineno": 551, "end_col_offset": 36, "src": "20734:9:0", "end_lineno": 551, "node_id": 1321, "type": {"name": "max_value", "typeclass": "builtin_function"}}, "node_id": 1320, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "col_offset": 7, "left": {"ast_type": "Name", "col_offset": 7, "id": "current_allowance", "lineno": 551, "end_col_offset": 24, "src": "20714:17:0", "end_lineno": 551, "node_id": 1317, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "current_allowance", "decl_node": {"node_id": 1298, "source_id": 0}, "access_path": []}]}, "lineno": 551, "end_col_offset": 45, "src": "20714:38:0", "end_lineno": 551, "node_id": 1316, "type": {"name": "bool"}}, "lineno": 551, "end_col_offset": 76, "src": "20711:554:0", "end_lineno": 559, "node_id": 1315}], "args": {"ast_type": "arguments", "col_offset": 0, "defaults": [], "args": [{"ast_type": "arg", "col_offset": 21, "lineno": 537, "annotation": {"ast_type": "Name", "col_offset": 28, "id": "address", "lineno": 537, "end_col_offset": 35, "src": "20110:7:0", "end_lineno": 537, "node_id": 1288}, "end_col_offset": 35, "src": "20103:14:0", "end_lineno": 537, "arg": "owner", "node_id": 1287}, {"ast_type": "arg", "col_offset": 37, "lineno": 537, "annotation": {"ast_type": "Name", "col_offset": 46, "id": "address", "lineno": 537, "end_col_offset": 53, "src": "20128:7:0", "end_lineno": 537, "node_id": 1291}, "end_col_offset": 53, "src": "20119:16:0", "end_lineno": 537, "arg": "spender", "node_id": 1290}, {"ast_type": "arg", "col_offset": 55, "lineno": 537, "annotation": {"ast_type": "Name", "col_offset": 63, "id": "uint256", "lineno": 537, "end_col_offset": 70, "src": "20145:7:0", "end_lineno": 537, "node_id": 1294}, "end_col_offset": 70, "src": "20137:15:0", "end_lineno": 537, "arg": "amount", "node_id": 1293}], "lineno": 537, "end_col_offset": 76, "default": null, "src": "20082:1183:0", "end_lineno": 559, "node_id": 1286}, "lineno": 537, "end_col_offset": 76, "pos": null, "src": "20082:1183:0", "decorator_list": [{"ast_type": "Name", "col_offset": 1, "id": "internal", "lineno": 536, "end_col_offset": 9, "src": "20073:8:0", "end_lineno": 536, "node_id": 1350}], "end_lineno": 559, "node_id": 1285, "doc_string": {"ast_type": "DocStr", "col_offset": 4, "value": "\n @dev Updates `owner`'s allowance for `spender`\n based on spent `amount`.\n @notice WARNING: Note that it does not update the\n allowance `amount` in case of infinite\n allowance. Also, it reverts if not enough\n allowance is available.\n @param owner The 20-byte owner address.\n @param spender The 20-byte spender address.\n @param amount The 32-byte token amount that is\n allowed to be spent by the `spender`.\n ", "lineno": 538, "end_col_offset": 7, "src": "20159:483:0", "end_lineno": 549, "node_id": 1352}, "name": "_spend_allowance"}, {"ast_type": "FunctionDef", "col_offset": 0, "returns": null, "body": [{"ast_type": "Pass", "col_offset": 4, "lineno": 580, "end_col_offset": 8, "src": "22042:4:0", "end_lineno": 580, "node_id": 1366}], "args": {"ast_type": "arguments", "col_offset": 0, "defaults": [], "args": [{"ast_type": "arg", "col_offset": 27, "lineno": 563, "annotation": {"ast_type": "Name", "col_offset": 34, "id": "address", "lineno": 563, "end_col_offset": 41, "src": "21312:7:0", "end_lineno": 563, "node_id": 1356}, "end_col_offset": 41, "src": "21305:14:0", "end_lineno": 563, "arg": "owner", "node_id": 1355}, {"ast_type": "arg", "col_offset": 43, "lineno": 563, "annotation": {"ast_type": "Name", "col_offset": 47, "id": "address", "lineno": 563, "end_col_offset": 54, "src": "21325:7:0", "end_lineno": 563, "node_id": 1359}, "end_col_offset": 54, "src": "21321:11:0", "end_lineno": 563, "arg": "to", "node_id": 1358}, {"ast_type": "arg", "col_offset": 56, "lineno": 563, "annotation": {"ast_type": "Name", "col_offset": 64, "id": "uint256", "lineno": 563, "end_col_offset": 71, "src": "21342:7:0", "end_lineno": 563, "node_id": 1362}, "end_col_offset": 71, "src": "21334:15:0", "end_lineno": 563, "arg": "amount", "node_id": 1361}], "lineno": 563, "end_col_offset": 8, "default": null, "src": "21278:768:0", "end_lineno": 580, "node_id": 1354}, "lineno": 563, "end_col_offset": 8, "pos": null, "src": "21278:768:0", "decorator_list": [{"ast_type": "Name", "col_offset": 1, "id": "internal", "lineno": 562, "end_col_offset": 9, "src": "21269:8:0", "end_lineno": 562, "node_id": 1367}], "end_lineno": 580, "node_id": 1353, "doc_string": {"ast_type": "DocStr", "col_offset": 4, "value": "\n @dev Hook that is called before any transfer of tokens.\n This includes minting and burning.\n @notice The calling conditions are:\n - when `owner` and `to` are both non-zero,\n `amount` of `owner`'s tokens will be\n transferred to `to`,\n - when `owner` is zero, `amount` tokens will\n be minted for `to`,\n - when `to` is zero, `amount` of `owner`'s\n tokens will be burned,\n - `owner` and `to` are never both zero.\n @param owner The 20-byte owner address.\n @param to The 20-byte receiver address.\n @param amount The 32-byte token amount to be transferred.\n ", "lineno": 564, "end_col_offset": 7, "src": "21356:681:0", "end_lineno": 579, "node_id": 1369}, "name": "_before_token_transfer"}, {"ast_type": "FunctionDef", "col_offset": 0, "returns": null, "body": [{"ast_type": "Pass", "col_offset": 4, "lineno": 602, "end_col_offset": 8, "src": "22845:4:0", "end_lineno": 602, "node_id": 1383}], "args": {"ast_type": "arguments", "col_offset": 0, "defaults": [], "args": [{"ast_type": "arg", "col_offset": 26, "lineno": 584, "annotation": {"ast_type": "Name", "col_offset": 33, "id": "address", "lineno": 584, "end_col_offset": 40, "src": "22092:7:0", "end_lineno": 584, "node_id": 1373}, "end_col_offset": 40, "src": "22085:14:0", "end_lineno": 584, "arg": "owner", "node_id": 1372}, {"ast_type": "arg", "col_offset": 42, "lineno": 584, "annotation": {"ast_type": "Name", "col_offset": 46, "id": "address", "lineno": 584, "end_col_offset": 53, "src": "22105:7:0", "end_lineno": 584, "node_id": 1376}, "end_col_offset": 53, "src": "22101:11:0", "end_lineno": 584, "arg": "to", "node_id": 1375}, {"ast_type": "arg", "col_offset": 55, "lineno": 584, "annotation": {"ast_type": "Name", "col_offset": 63, "id": "uint256", "lineno": 584, "end_col_offset": 70, "src": "22122:7:0", "end_lineno": 584, "node_id": 1379}, "end_col_offset": 70, "src": "22114:15:0", "end_lineno": 584, "arg": "amount", "node_id": 1378}], "lineno": 584, "end_col_offset": 8, "default": null, "src": "22059:790:0", "end_lineno": 602, "node_id": 1371}, "lineno": 584, "end_col_offset": 8, "pos": null, "src": "22059:790:0", "decorator_list": [{"ast_type": "Name", "col_offset": 1, "id": "internal", "lineno": 583, "end_col_offset": 9, "src": "22050:8:0", "end_lineno": 583, "node_id": 1384}], "end_lineno": 602, "node_id": 1370, "doc_string": {"ast_type": "DocStr", "col_offset": 4, "value": "\n @dev Hook that is called after any transfer of tokens.\n This includes minting and burning.\n @notice The calling conditions are:\n - when `owner` and `to` are both non-zero,\n `amount` of `owner`'s tokens has been\n transferred to `to`,\n - when `owner` is zero, `amount` tokens\n have been minted for `to`,\n - when `to` is zero, `amount` of `owner`'s\n tokens have been burned,\n - `owner` and `to` are never both zero.\n @param owner The 20-byte owner address.\n @param to The 20-byte receiver address.\n @param amount The 32-byte token amount that has\n been transferred.\n ", "lineno": 585, "end_col_offset": 7, "src": "22136:704:0", "end_lineno": 601, "node_id": 1386}, "name": "_after_token_transfer"}], "lineno": 1, "resolved_path": "/home/user/tmp/snekmate/src/snekmate/tokens/erc20.vy", "end_col_offset": 9, "is_interface": false, "source_id": 0, "src": "0:22850:0", "end_lineno": 602, "node_id": 0, "doc_string": {"ast_type": "DocStr", "col_offset": 0, "value": "\n@title Modern and Gas-Efficient ERC-20 + EIP-2612 Implementation\n@custom:contract-name erc20\n@license GNU Affero General Public License v3.0 only\n@author pcaversaccio\n@notice These functions implement the ERC-20\n standard interface:\n - https://eips.ethereum.org/EIPS/eip-20.\n In addition, the following functions have\n been added for convenience:\n - `name` (`external` `view` function),\n - `symbol` (`external` `view` function),\n - `decimals` (`external` `view` function),\n - `burn` (`external` function),\n - `burn_from` (`external` function),\n - `is_minter` (`external` `view` function),\n - `mint` (`external` function),\n - `set_minter` (`external` function),\n - `permit` (`external` function),\n - `nonces` (`external` `view` function),\n - `DOMAIN_SEPARATOR` (`external` `view` function),\n - `eip712Domain` (`external` `view` function),\n - `owner` (`external` `view` function),\n - `transfer_ownership` (`external` function),\n - `renounce_ownership` (`external` function),\n - `_before_token_transfer` (`internal` function),\n - `_after_token_transfer` (`internal` function).\n The `permit` function implements approvals via\n EIP-712 secp256k1 signatures:\n https://eips.ethereum.org/EIPS/eip-2612.\n In addition, this contract also implements the EIP-5267\n function `eip712Domain`:\n https://eips.ethereum.org/EIPS/eip-5267.\n The implementation is inspired by OpenZeppelin's\n implementation here:\n https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol,\n as well as by ApeAcademy's implementation here:\n https://github.com/ApeAcademy/ERC20/blob/main/%7B%7Bcookiecutter.project_name%7D%7D/contracts/Token.vy.\n@custom:security This ERC-20 implementation allows the commonly known\n address poisoning attack, where `transferFrom` instructions\n are executed from arbitrary addresses with an `amount` of `0`.\n However, this poisoning attack is not an on-chain vulnerability.\n All assets are safe. It is an off-chain log interpretation issue.\n The main reason why we do not disallow address poisonig is that\n we do not want to potentially break any DeFi composability.\n This issue has been extensively discussed here:\n https://github.com/pcaversaccio/snekmate/issues/51,\n as well as in the OpenZeppelin repository:\n https://github.com/OpenZeppelin/openzeppelin-contracts/issues/3931.\n", "lineno": 3, "end_col_offset": 3, "src": "52:2707:0", "end_lineno": 52, "node_id": 1387}, "name": null, "type": {"name": "src/snekmate/tokens/erc20.vy", "type_decl_node": {"node_id": 0, "source_id": 0}, "typeclass": "module"}} \ No newline at end of file diff --git a/test-data/vyper_ast/flags.json b/test-data/vyper_ast/flags.json new file mode 100644 index 000000000..0e5ddddaa --- /dev/null +++ b/test-data/vyper_ast/flags.json @@ -0,0 +1 @@ +{"source_sha256sum": "7bc19817da8b76c71203c858978745ce16d230e1a846bdff0eaa0676b7f073f7", "col_offset": 0, "path": "flag.vy", "end_col_offset": 23, "src": "0:201:0", "end_lineno": 11, "settings": {}, "name": null, "node_id": 0, "is_interface": false, "ast_type": "Module", "lineno": 1, "resolved_path": "/tmp/vyper_samples/flag.vy", "body": [{"col_offset": 0, "end_col_offset": 8, "src": "35:30:0", "end_lineno": 4, "node_id": 1, "ast_type": "FlagDef", "lineno": 2, "name": "Roles", "body": [{"end_col_offset": 9, "src": "51:5:0", "end_lineno": 3, "node_id": 2, "ast_type": "Expr", "lineno": 3, "value": {"end_col_offset": 9, "src": "51:5:0", "end_lineno": 3, "node_id": 3, "id": "ADMIN", "ast_type": "Name", "lineno": 3, "col_offset": 4}, "col_offset": 4}, {"end_col_offset": 8, "src": "61:4:0", "end_lineno": 4, "node_id": 5, "ast_type": "Expr", "lineno": 4, "value": {"end_col_offset": 8, "src": "61:4:0", "end_lineno": 4, "node_id": 6, "id": "USER", "ast_type": "Name", "lineno": 4, "col_offset": 4}, "col_offset": 4}], "doc_string": null}, {"args": {"args": [], "default": null, "end_col_offset": 22, "src": "67:133:0", "end_lineno": 11, "defaults": [], "node_id": 9, "ast_type": "arguments", "lineno": 6, "col_offset": 0}, "end_col_offset": 22, "src": "67:133:0", "end_lineno": 11, "returns": {"end_col_offset": 21, "src": "83:5:0", "end_lineno": 6, "node_id": 24, "id": "Roles", "ast_type": "Name", "lineno": 6, "col_offset": 16}, "name": "define", "pos": null, "node_id": 8, "ast_type": "FunctionDef", "lineno": 6, "body": [{"col_offset": 4, "end_col_offset": 29, "src": "126:25:0", "end_lineno": 8, "node_id": 10, "target": {"end_col_offset": 8, "src": "126:4:0", "end_lineno": 8, "node_id": 11, "id": "role", "ast_type": "Name", "lineno": 8, "col_offset": 4, "type": {"name": "Roles", "typeclass": "flag"}, "variable_reads": [{"name": "role", "decl_node": {"node_id": 10, "source_id": 0}, "access_path": []}]}, "ast_type": "AnnAssign", "lineno": 8, "value": {"end_col_offset": 29, "src": "140:11:0", "end_lineno": 8, "node_id": 15, "ast_type": "Attribute", "lineno": 8, "attr": "ADMIN", "value": {"end_col_offset": 23, "src": "140:5:0", "end_lineno": 8, "node_id": 16, "id": "Roles", "ast_type": "Name", "lineno": 8, "col_offset": 18, "type": {"type_t": {"name": "Roles", "typeclass": "flag"}}}, "col_offset": 18, "type": {"name": "Roles", "typeclass": "flag"}}, "annotation": {"end_col_offset": 15, "src": "132:5:0", "end_lineno": 8, "node_id": 13, "id": "Roles", "ast_type": "Name", "lineno": 8, "col_offset": 10}}, {"end_col_offset": 22, "src": "182:18:0", "end_lineno": 11, "node_id": 19, "ast_type": "Return", "lineno": 11, "value": {"end_col_offset": 22, "src": "189:11:0", "end_lineno": 11, "node_id": 20, "ast_type": "Attribute", "lineno": 11, "attr": "ADMIN", "value": {"end_col_offset": 16, "src": "189:5:0", "end_lineno": 11, "node_id": 21, "id": "Roles", "ast_type": "Name", "lineno": 11, "col_offset": 11, "type": {"type_t": {"name": "Roles", "typeclass": "flag"}}}, "col_offset": 11, "type": {"name": "Roles", "typeclass": "flag"}}, "col_offset": 4}], "col_offset": 0, "doc_string": null, "decorator_list": []}], "source_id": 0, "doc_string": null, "type": {"name": "flag.vy", "type_decl_node": {"node_id": 0, "source_id": 0}, "typeclass": "module"}} \ No newline at end of file diff --git a/test-data/vyper_ast/for.json b/test-data/vyper_ast/for.json new file mode 100644 index 000000000..f9ea3c86c --- /dev/null +++ b/test-data/vyper_ast/for.json @@ -0,0 +1 @@ +{"source_sha256sum": "cc3f69c1149c59f8577fd8a1e8be38c058b4f94d889f38897ca11407b37bb2fb", "name": null, "lineno": 1, "is_interface": false, "settings": {}, "source_id": 0, "path": "for.vy", "body": [{"name": "loop", "lineno": 1, "body": [{"target": {"target": {"id": "i", "lineno": 2, "src": "18:1:0", "col_offset": 6, "ast_type": "Name", "end_col_offset": 7, "node_id": 5, "end_lineno": 2, "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}, "variable_reads": [{"name": "i", "decl_node": {"node_id": 4, "source_id": 0}, "access_path": []}]}, "lineno": 1, "value": null, "src": "0:27:0", "annotation": {"id": "int128", "lineno": 2, "src": "21:6:0", "col_offset": 9, "ast_type": "Name", "end_col_offset": 15, "node_id": 7, "end_lineno": 2}, "ast_type": "AnnAssign", "col_offset": 0, "node_id": 4, "end_col_offset": 15, "end_lineno": 2}, "lineno": 2, "body": [{"lineno": 3, "src": "50:4:0", "col_offset": 6, "ast_type": "Pass", "end_col_offset": 10, "node_id": 14, "end_lineno": 3}], "src": "14:40:0", "iter": {"lineno": 2, "elements": [{"lineno": 2, "value": 4, "src": "32:1:0", "col_offset": 20, "ast_type": "Int", "node_id": 10, "end_col_offset": 21, "end_lineno": 2, "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}}, {"lineno": 2, "value": 23, "src": "35:2:0", "col_offset": 23, "ast_type": "Int", "node_id": 11, "end_col_offset": 25, "end_lineno": 2, "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}}, {"lineno": 2, "value": 42, "src": "39:2:0", "col_offset": 27, "ast_type": "Int", "node_id": 12, "end_col_offset": 29, "end_lineno": 2, "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}}], "src": "31:11:0", "col_offset": 19, "ast_type": "List", "end_col_offset": 30, "node_id": 9, "end_lineno": 2, "type": {"value_type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}, "length": 3, "name": "$SArray", "typeclass": "static_array"}}, "col_offset": 2, "ast_type": "For", "node_id": 3, "end_col_offset": 10, "end_lineno": 3}], "src": "0:54:0", "returns": null, "args": {"lineno": 1, "default": null, "defaults": [], "src": "0:54:0", "args": [], "col_offset": 0, "ast_type": "arguments", "node_id": 2, "end_col_offset": 10, "end_lineno": 3}, "end_lineno": 3, "decorator_list": [], "ast_type": "FunctionDef", "col_offset": 0, "doc_string": null, "node_id": 1, "pos": null, "end_col_offset": 10}], "src": "0:55:0", "end_lineno": 3, "col_offset": 0, "ast_type": "Module", "doc_string": null, "node_id": 0, "end_col_offset": 11, "resolved_path": "/tmp/vyper_samples/for.vy", "type": {"name": "for.vy", "type_decl_node": {"node_id": 0, "source_id": 0}, "typeclass": "module"}} \ No newline at end of file diff --git a/test-data/vyper_ast/implements.json b/test-data/vyper_ast/implements.json new file mode 100644 index 000000000..bda05795d --- /dev/null +++ b/test-data/vyper_ast/implements.json @@ -0,0 +1 @@ +{"source_sha256sum": "f70e64afd8899e0e0c0ab93e699f2d4e1d7babb36184fce3c6e859a427795c84", "resolved_path": "/tmp/vyper_samples/implements.vy", "ast_type": "Module", "settings": {}, "path": "implements.vy", "source_id": 0, "body": [{"ast_type": "InterfaceDef", "body": [{"pos": null, "ast_type": "FunctionDef", "decorator_list": [], "body": [{"value": {"ast_type": "Name", "id": "nonpayable", "end_lineno": 2, "lineno": 2, "src": "35:10:0", "node_id": 5, "end_col_offset": 27, "col_offset": 17}, "ast_type": "Expr", "end_lineno": 2, "lineno": 2, "src": "35:10:0", "node_id": 4, "end_col_offset": 27, "col_offset": 17}], "end_lineno": 2, "lineno": 2, "src": "22:23:0", "node_id": 2, "args": {"ast_type": "arguments", "end_lineno": 2, "lineno": 2, "src": "22:23:0", "node_id": 3, "defaults": [], "args": [], "end_col_offset": 27, "col_offset": 4, "default": null}, "doc_string": null, "end_col_offset": 27, "name": "test1", "col_offset": 4, "returns": null}], "end_lineno": 2, "lineno": 1, "src": "0:45:0", "node_id": 1, "end_col_offset": 27, "name": "FooBar", "col_offset": 0, "doc_string": null}, {"ast_type": "ImplementsDecl", "annotation": {"ast_type": "Name", "id": "FooBar", "end_lineno": 4, "lineno": 4, "src": "59:6:0", "node_id": 10, "end_col_offset": 18, "col_offset": 12}, "end_lineno": 4, "lineno": 4, "src": "47:18:0", "node_id": 7, "end_col_offset": 18, "col_offset": 0}, {"pos": null, "ast_type": "FunctionDef", "decorator_list": [{"ast_type": "Name", "id": "external", "end_lineno": 6, "lineno": 6, "src": "68:8:0", "node_id": 15, "end_col_offset": 9, "col_offset": 1}], "body": [{"ast_type": "Pass", "end_lineno": 8, "lineno": 8, "src": "94:4:0", "node_id": 14, "end_col_offset": 8, "col_offset": 4}], "end_lineno": 8, "lineno": 7, "src": "77:21:0", "node_id": 12, "args": {"ast_type": "arguments", "end_lineno": 8, "lineno": 7, "src": "77:21:0", "node_id": 13, "defaults": [], "args": [], "end_col_offset": 8, "col_offset": 0, "default": null}, "doc_string": null, "end_col_offset": 8, "name": "test1", "col_offset": 0, "returns": null}], "end_lineno": 8, "lineno": 1, "src": "0:99:0", "node_id": 0, "end_col_offset": 9, "name": null, "col_offset": 0, "doc_string": null, "is_interface": false, "type": {"name": "implements.vy", "type_decl_node": {"node_id": 0, "source_id": 0}, "typeclass": "module"}} \ No newline at end of file diff --git a/test-data/vyper_ast/import.json b/test-data/vyper_ast/import.json new file mode 100644 index 000000000..b14a93291 --- /dev/null +++ b/test-data/vyper_ast/import.json @@ -0,0 +1 @@ +{"source_sha256sum": "a4614dc8e94ab8c9608e0c5f4ca840a0b2cc42711b7191670dbe0187b9829315", "is_interface": false, "ast_type": "Module", "lineno": 1, "path": "own_use.vy", "doc_string": null, "src": "0:107:0", "end_col_offset": 32, "end_lineno": 4, "source_id": 0, "body": [{"ast_type": "Import", "lineno": 1, "alias": "helper", "src": "0:24:0", "end_col_offset": 24, "end_lineno": 1, "node_id": 1, "name": "ownable", "col_offset": 0, "import_info": {"alias": "helper", "qualified_module_name": "ownable", "source_id": 1, "path": "ownable.vy", "resolved_path": "/tmp/vyper_samples/ownable.vy", "file_sha256sum": "1cd46e050e25e986e0eed961602be8566b2b4e6094d6686946a11ca1c1eb4a26"}}, {"ast_type": "FunctionDef", "lineno": 3, "doc_string": null, "col_offset": 0, "src": "35:71:0", "end_col_offset": 31, "returns": {"ast_type": "Name", "lineno": 3, "id": "uint256", "src": "66:7:0", "end_col_offset": 38, "end_lineno": 3, "node_id": 18, "col_offset": 31}, "end_lineno": 4, "args": {"ast_type": "arguments", "lineno": 3, "src": "35:71:0", "defaults": [], "end_col_offset": 31, "end_lineno": 4, "args": [{"ast_type": "arg", "lineno": 3, "arg": "x", "src": "51:10:0", "end_col_offset": 26, "end_lineno": 3, "annotation": {"ast_type": "Name", "lineno": 3, "id": "uint256", "src": "54:7:0", "end_col_offset": 26, "end_lineno": 3, "node_id": 6, "col_offset": 19}, "node_id": 5, "col_offset": 16}], "default": null, "node_id": 4, "col_offset": 0}, "decorator_list": [{"ast_type": "Name", "lineno": 2, "id": "external", "src": "26:8:0", "end_col_offset": 9, "end_lineno": 2, "node_id": 16, "col_offset": 1}], "body": [{"ast_type": "Return", "lineno": 4, "value": {"ast_type": "Call", "func": {"ast_type": "Attribute", "lineno": 4, "value": {"ast_type": "Name", "lineno": 4, "id": "helper", "src": "86:6:0", "end_col_offset": 17, "end_lineno": 4, "node_id": 11, "col_offset": 11, "type": {"name": "ownable.vy", "type_decl_node": {"node_id": 0, "source_id": 1}, "typeclass": "module"}}, "attr": "_times_two", "src": "86:17:0", "end_col_offset": 28, "end_lineno": 4, "node_id": 10, "col_offset": 11, "type": {"name": "_times_two", "type_decl_node": {"node_id": 32, "source_id": 1}, "typeclass": "contract_function"}}, "keywords": [], "lineno": 4, "src": "86:20:0", "end_col_offset": 31, "end_lineno": 4, "args": [{"ast_type": "Name", "lineno": 4, "id": "x", "src": "104:1:0", "end_col_offset": 30, "end_lineno": 4, "node_id": 14, "col_offset": 29, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "x", "decl_node": {"node_id": 5, "source_id": 0}, "access_path": []}]}], "node_id": 9, "col_offset": 11, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "src": "79:27:0", "end_col_offset": 31, "end_lineno": 4, "node_id": 8, "col_offset": 4}], "node_id": 3, "name": "my_function", "pos": null}], "settings": {}, "resolved_path": "/tmp/vyper_samples/own_use.vy", "node_id": 0, "name": null, "col_offset": 0, "type": {"name": "own_use.vy", "type_decl_node": {"node_id": 0, "source_id": 0}, "typeclass": "module"}} \ No newline at end of file diff --git a/test-data/vyper_ast/import_from.json b/test-data/vyper_ast/import_from.json new file mode 100644 index 000000000..a6f53c805 --- /dev/null +++ b/test-data/vyper_ast/import_from.json @@ -0,0 +1 @@ +{"source_sha256sum": "43d7befe82f9e698b48a80686a25568a9965bd04e9b763b8245c29cbcacc4fdd", "doc_string": null, "node_id": 0, "source_id": 0, "is_interface": false, "end_col_offset": 32, "src": "0:114:0", "resolved_path": "/tmp/vyper_samples/own_use.vy", "body": [{"node_id": 1, "alias": "helper", "module": null, "level": 1, "end_col_offset": 31, "src": "0:31:0", "lineno": 1, "end_lineno": 1, "name": "ownable", "col_offset": 0, "ast_type": "ImportFrom", "import_info": {"alias": "helper", "qualified_module_name": "ownable", "source_id": 1, "path": "ownable.vy", "resolved_path": "/tmp/vyper_samples/ownable.vy", "file_sha256sum": "1cd46e050e25e986e0eed961602be8566b2b4e6094d6686946a11ca1c1eb4a26"}}, {"doc_string": null, "node_id": 3, "decorator_list": [{"node_id": 16, "end_col_offset": 9, "id": "external", "src": "33:8:0", "lineno": 2, "end_lineno": 2, "col_offset": 1, "ast_type": "Name"}], "pos": null, "returns": {"node_id": 18, "end_col_offset": 38, "id": "uint256", "src": "73:7:0", "lineno": 3, "end_lineno": 3, "col_offset": 31, "ast_type": "Name"}, "end_col_offset": 31, "src": "42:71:0", "body": [{"node_id": 8, "end_col_offset": 31, "value": {"node_id": 9, "func": {"node_id": 10, "value": {"node_id": 11, "end_col_offset": 17, "id": "helper", "src": "93:6:0", "lineno": 4, "end_lineno": 4, "col_offset": 11, "ast_type": "Name", "type": {"name": "ownable.vy", "type_decl_node": {"node_id": 0, "source_id": 1}, "typeclass": "module"}}, "end_col_offset": 28, "src": "93:17:0", "attr": "_times_two", "lineno": 4, "end_lineno": 4, "col_offset": 11, "ast_type": "Attribute", "type": {"name": "_times_two", "type_decl_node": {"node_id": 32, "source_id": 1}, "typeclass": "contract_function"}}, "end_col_offset": 31, "src": "93:20:0", "args": [{"node_id": 14, "end_col_offset": 30, "id": "x", "src": "111:1:0", "lineno": 4, "end_lineno": 4, "col_offset": 29, "ast_type": "Name", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "x", "decl_node": {"node_id": 5, "source_id": 0}, "access_path": []}]}], "lineno": 4, "end_lineno": 4, "col_offset": 11, "keywords": [], "ast_type": "Call", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "src": "86:27:0", "lineno": 4, "end_lineno": 4, "col_offset": 4, "ast_type": "Return"}], "args": {"node_id": 4, "end_col_offset": 31, "src": "42:71:0", "args": [{"node_id": 5, "arg": "x", "end_col_offset": 26, "src": "58:10:0", "lineno": 3, "end_lineno": 3, "annotation": {"node_id": 6, "end_col_offset": 26, "id": "uint256", "src": "61:7:0", "lineno": 3, "end_lineno": 3, "col_offset": 19, "ast_type": "Name"}, "col_offset": 16, "ast_type": "arg"}], "default": null, "lineno": 3, "end_lineno": 4, "defaults": [], "col_offset": 0, "ast_type": "arguments"}, "lineno": 3, "end_lineno": 4, "name": "my_function", "col_offset": 0, "ast_type": "FunctionDef"}], "lineno": 1, "end_lineno": 4, "name": null, "col_offset": 0, "path": "own_use.vy", "settings": {}, "ast_type": "Module", "type": {"name": "own_use.vy", "type_decl_node": {"node_id": 0, "source_id": 0}, "typeclass": "module"}} \ No newline at end of file diff --git a/test-data/vyper_ast/initializes.json b/test-data/vyper_ast/initializes.json new file mode 100644 index 000000000..d80db750d --- /dev/null +++ b/test-data/vyper_ast/initializes.json @@ -0,0 +1 @@ +{"source_sha256sum": "12dff929d2763f5dfc641772ab7b542d1e298e053c27a6ef5b019dfd810fdad6", "resolved_path": "/tmp/vyper_samples/initializes.vy", "src": "0:92:0", "node_id": 0, "doc_string": null, "ast_type": "Module", "body": [{"level": 1, "src": "0:21:0", "node_id": 1, "ast_type": "ImportFrom", "end_lineno": 1, "alias": null, "module": null, "lineno": 1, "end_col_offset": 21, "col_offset": 0, "name": "ownable", "import_info": {"alias": "ownable", "qualified_module_name": "ownable", "source_id": 1, "path": "ownable.vy", "resolved_path": "/tmp/vyper_samples/ownable.vy", "file_sha256sum": "e275d6c33ee4a73392fe396eef2c2695b2a90d802aa6ba2a20f26ed5fb4a7bbe"}}, {"annotation": {"src": "36:7:0", "node_id": 6, "ast_type": "Name", "end_lineno": 3, "lineno": 3, "id": "ownable", "end_col_offset": 20, "col_offset": 13}, "src": "23:20:0", "node_id": 3, "ast_type": "InitializesDecl", "end_lineno": 3, "lineno": 3, "end_col_offset": 20, "col_offset": 0}, {"decorator_list": [{"src": "46:6:0", "node_id": 16, "ast_type": "Name", "end_lineno": 5, "lineno": 5, "id": "deploy", "end_col_offset": 7, "col_offset": 1}], "src": "53:38:0", "node_id": 8, "doc_string": null, "ast_type": "FunctionDef", "body": [{"value": {"src": "73:18:0", "node_id": 11, "ast_type": "Call", "func": {"value": {"src": "73:7:0", "node_id": 13, "ast_type": "Name", "end_lineno": 7, "lineno": 7, "id": "ownable", "end_col_offset": 11, "col_offset": 4, "type": {"name": "ownable.vy", "type_decl_node": {"node_id": 0, "source_id": 1}, "typeclass": "module"}}, "attr": "__init__", "src": "73:16:0", "node_id": 12, "ast_type": "Attribute", "end_lineno": 7, "lineno": 7, "end_col_offset": 20, "col_offset": 4, "type": {"name": "__init__", "type_decl_node": {"node_id": 9, "source_id": 1}, "typeclass": "contract_function"}, "variable_reads": [{"name": "owner", "decl_node": {"node_id": 1, "source_id": 1}, "access_path": []}], "variable_writes": [{"name": "owner", "decl_node": {"node_id": 1, "source_id": 1}, "access_path": []}]}, "end_lineno": 7, "keywords": [], "lineno": 7, "end_col_offset": 22, "col_offset": 4, "args": [], "type": {"name": "(void)"}}, "src": "73:18:0", "node_id": 10, "ast_type": "Expr", "end_lineno": 7, "lineno": 7, "end_col_offset": 22, "col_offset": 4}], "returns": null, "pos": null, "end_lineno": 7, "lineno": 6, "end_col_offset": 22, "col_offset": 0, "name": "__init__", "args": {"src": "53:38:0", "defaults": [], "node_id": 9, "ast_type": "arguments", "end_lineno": 7, "default": null, "lineno": 6, "end_col_offset": 22, "col_offset": 0, "args": []}}], "end_lineno": 7, "settings": {}, "lineno": 1, "end_col_offset": 23, "source_id": 0, "col_offset": 0, "path": "initializes.vy", "name": null, "is_interface": false, "type": {"name": "initializes.vy", "type_decl_node": {"node_id": 0, "source_id": 0}, "typeclass": "module"}} \ No newline at end of file diff --git a/test-data/vyper_ast/raise.json b/test-data/vyper_ast/raise.json new file mode 100644 index 000000000..fa46a20b6 --- /dev/null +++ b/test-data/vyper_ast/raise.json @@ -0,0 +1 @@ +{"source_sha256sum": "f7dbca15dc0da6853aace736484f0188f5ca701c3f758a4ecde1c273be446e8b", "body": [{"body": [{"col_offset": 2, "ast_type": "Raise", "end_col_offset": 30, "lineno": 2, "exc": {"col_offset": 8, "ast_type": "Str", "end_col_offset": 30, "lineno": 2, "value": "something went wrong", "node_id": 4, "src": "20:22:0", "end_lineno": 2, "type": {"length": 20, "name": "String", "typeclass": "string"}}, "node_id": 3, "src": "14:28:0", "end_lineno": 2}], "col_offset": 0, "returns": null, "pos": null, "args": {"col_offset": 0, "args": [], "ast_type": "arguments", "end_col_offset": 30, "lineno": 1, "defaults": [], "default": null, "node_id": 2, "src": "0:42:0", "end_lineno": 2}, "name": "err1", "doc_string": null, "ast_type": "FunctionDef", "end_col_offset": 30, "lineno": 1, "decorator_list": [], "node_id": 1, "src": "0:42:0", "end_lineno": 2}, {"body": [{"col_offset": 2, "ast_type": "Raise", "end_col_offset": 7, "lineno": 5, "exc": null, "node_id": 7, "src": "58:5:0", "end_lineno": 5}], "col_offset": 0, "returns": null, "pos": null, "args": {"col_offset": 0, "args": [], "ast_type": "arguments", "end_col_offset": 7, "lineno": 4, "defaults": [], "default": null, "node_id": 6, "src": "44:19:0", "end_lineno": 5}, "name": "err2", "doc_string": null, "ast_type": "FunctionDef", "end_col_offset": 7, "lineno": 4, "decorator_list": [], "node_id": 5, "src": "44:19:0", "end_lineno": 5}], "source_id": 0, "col_offset": 0, "settings": {}, "resolved_path": "/tmp/vyper_samples/raise.vy", "name": null, "doc_string": null, "ast_type": "Module", "end_col_offset": 8, "lineno": 1, "is_interface": false, "path": "raise.vy", "node_id": 0, "src": "0:64:0", "end_lineno": 5, "type": {"name": "raise.vy", "type_decl_node": {"node_id": 0, "source_id": 0}, "typeclass": "module"}} \ No newline at end of file diff --git a/test-data/vyper_ast/struct.json b/test-data/vyper_ast/struct.json new file mode 100644 index 000000000..fb89938fa --- /dev/null +++ b/test-data/vyper_ast/struct.json @@ -0,0 +1 @@ +{"source_sha256sum": "04bdcab9403f860e37601a1e1589d22deb9ff4cec2770a13e0cb4170f9596a41", "lineno": 1, "path": "struct.vy", "source_id": 0, "resolved_path": "/tmp/vyper_samples/struct.vy", "body": [{"lineno": 2, "doc_string": null, "node_id": 1, "name": "MyStruct", "ast_type": "StructDef", "src": "20:55:0", "end_col_offset": 19, "end_lineno": 4, "body": [{"lineno": 3, "node_id": 2, "ast_type": "AnnAssign", "src": "41:14:0", "annotation": {"lineno": 3, "node_id": 5, "ast_type": "Name", "src": "49:6:0", "end_col_offset": 18, "end_lineno": 3, "id": "int128", "col_offset": 12}, "end_col_offset": 18, "end_lineno": 3, "value": null, "target": {"lineno": 3, "node_id": 3, "ast_type": "Name", "src": "41:6:0", "end_col_offset": 10, "end_lineno": 3, "id": "value1", "col_offset": 4}, "col_offset": 4}, {"lineno": 4, "node_id": 7, "ast_type": "AnnAssign", "src": "60:15:0", "annotation": {"lineno": 4, "node_id": 10, "ast_type": "Name", "src": "68:7:0", "end_col_offset": 19, "end_lineno": 4, "id": "decimal", "col_offset": 12}, "end_col_offset": 19, "end_lineno": 4, "value": null, "target": {"lineno": 4, "node_id": 8, "ast_type": "Name", "src": "60:6:0", "end_col_offset": 10, "end_lineno": 4, "id": "value2", "col_offset": 4}, "col_offset": 4}], "col_offset": 0}, {"lineno": 7, "pos": null, "doc_string": null, "node_id": 12, "args": {"lineno": 7, "node_id": 13, "default": null, "args": [], "ast_type": "arguments", "src": "85:156:0", "end_col_offset": 26, "end_lineno": 12, "defaults": [], "col_offset": 0}, "returns": null, "name": "__init__", "ast_type": "FunctionDef", "end_col_offset": 26, "end_lineno": 12, "decorator_list": [{"lineno": 6, "node_id": 32, "ast_type": "Name", "src": "78:6:0", "end_col_offset": 7, "end_lineno": 6, "id": "deploy", "col_offset": 1}], "src": "85:156:0", "body": [{"lineno": 9, "node_id": 14, "ast_type": "AnnAssign", "src": "135:56:0", "annotation": {"lineno": 9, "node_id": 17, "ast_type": "Name", "src": "150:8:0", "end_col_offset": 25, "end_lineno": 9, "id": "MyStruct", "col_offset": 17}, "end_col_offset": 58, "end_lineno": 9, "value": {"lineno": 9, "node_id": 19, "args": [], "ast_type": "Call", "src": "161:30:0", "end_col_offset": 58, "end_lineno": 9, "keywords": [{"lineno": 9, "arg": "value1", "node_id": 22, "ast_type": "keyword", "src": "170:8:0", "end_col_offset": 45, "end_lineno": 9, "value": {"lineno": 9, "node_id": 23, "ast_type": "Int", "src": "177:1:0", "end_col_offset": 45, "end_lineno": 9, "value": 1, "col_offset": 44, "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}}, "col_offset": 37}, {"lineno": 9, "arg": "value2", "node_id": 24, "ast_type": "keyword", "src": "180:10:0", "end_col_offset": 57, "end_lineno": 9, "value": {"lineno": 9, "node_id": 25, "ast_type": "Decimal", "src": "187:3:0", "end_col_offset": 57, "end_lineno": 9, "value": "2.0", "col_offset": 54, "type": {"name": "decimal", "typeclass": "decimal"}}, "col_offset": 47}], "func": {"lineno": 9, "node_id": 20, "ast_type": "Name", "src": "161:8:0", "end_col_offset": 36, "end_lineno": 9, "id": "MyStruct", "col_offset": 28, "type": {"type_t": {"name": "MyStruct", "typeclass": "struct"}}}, "col_offset": 28, "type": {"name": "MyStruct", "typeclass": "struct"}}, "target": {"lineno": 9, "node_id": 15, "ast_type": "Name", "src": "135:13:0", "end_col_offset": 15, "end_lineno": 9, "id": "exampleStruct", "col_offset": 2, "type": {"name": "MyStruct", "typeclass": "struct"}, "variable_reads": [{"name": "exampleStruct", "decl_node": {"node_id": 14, "source_id": 0}, "access_path": []}]}, "col_offset": 2}, {"lineno": 12, "node_id": 26, "ast_type": "Assign", "src": "217:24:0", "end_col_offset": 26, "end_lineno": 12, "value": {"lineno": 12, "node_id": 31, "ast_type": "Int", "src": "240:1:0", "end_col_offset": 26, "end_lineno": 12, "value": 1, "col_offset": 25, "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}}, "target": {"lineno": 12, "node_id": 27, "ast_type": "Attribute", "src": "217:20:0", "attr": "value1", "end_col_offset": 22, "end_lineno": 12, "value": {"lineno": 12, "node_id": 28, "ast_type": "Name", "src": "217:13:0", "end_col_offset": 15, "end_lineno": 12, "id": "exampleStruct", "col_offset": 2, "type": {"name": "MyStruct", "typeclass": "struct"}, "variable_reads": [{"name": "exampleStruct", "decl_node": {"node_id": 14, "source_id": 0}, "access_path": []}]}, "col_offset": 2, "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}, "variable_reads": [{"name": "exampleStruct", "decl_node": {"node_id": 14, "source_id": 0}, "access_path": ["value1"]}], "variable_writes": [{"name": "exampleStruct", "decl_node": {"node_id": 14, "source_id": 0}, "access_path": ["value1"]}]}, "col_offset": 2}], "col_offset": 0}], "doc_string": null, "node_id": 0, "name": null, "ast_type": "Module", "src": "0:242:0", "end_col_offset": 27, "end_lineno": 12, "settings": {}, "is_interface": false, "col_offset": 0, "type": {"name": "struct.vy", "type_decl_node": {"node_id": 0, "source_id": 0}, "typeclass": "module"}} \ No newline at end of file diff --git a/test-data/vyper_ast/types.json b/test-data/vyper_ast/types.json new file mode 100644 index 000000000..4e2fe7881 --- /dev/null +++ b/test-data/vyper_ast/types.json @@ -0,0 +1 @@ +{"source_sha256sum": "db06ae2a677efa06b28e806b0dc9b81b41dee5c298353f6d9eb7bd9d78cfbce1", "lineno": 1, "path": "types.vy", "name": null, "settings": {}, "col_offset": 0, "end_lineno": 26, "end_col_offset": 33, "doc_string": null, "src": "0:819:0", "resolved_path": "/tmp/vyper_samples/types.vy", "body": [{"is_reentrant": false, "is_public": false, "annotation": {"lineno": 1, "end_lineno": 1, "id": "uint256", "col_offset": 22, "end_col_offset": 29, "src": "22:7:0", "node_id": 7, "ast_type": "Name"}, "lineno": 1, "is_transient": false, "value": {"lineno": 1, "end_lineno": 1, "value": 42, "col_offset": 33, "end_col_offset": 35, "src": "33:2:0", "node_id": 9, "ast_type": "Int", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "is_constant": true, "col_offset": 0, "end_lineno": 1, "end_col_offset": 35, "src": "0:35:0", "is_immutable": false, "target": {"lineno": 1, "end_lineno": 1, "id": "MY_CONSTANT", "col_offset": 0, "end_col_offset": 11, "src": "0:11:0", "node_id": 2, "ast_type": "Name"}, "node_id": 1, "ast_type": "VariableDecl", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, {"is_reentrant": false, "is_public": false, "annotation": {"lineno": 2, "end_lineno": 2, "value": {"lineno": 2, "end_lineno": 2, "id": "HashMap", "col_offset": 9, "end_col_offset": 16, "src": "45:7:0", "node_id": 14, "ast_type": "Name"}, "col_offset": 9, "end_col_offset": 34, "src": "45:25:0", "slice": {"lineno": 2, "end_lineno": 2, "col_offset": 17, "end_col_offset": 33, "src": "53:16:0", "elements": [{"lineno": 2, "end_lineno": 2, "id": "uint256", "col_offset": 17, "end_col_offset": 24, "src": "53:7:0", "node_id": 17, "ast_type": "Name"}, {"lineno": 2, "end_lineno": 2, "id": "address", "col_offset": 26, "end_col_offset": 33, "src": "62:7:0", "node_id": 19, "ast_type": "Name"}], "node_id": 16, "ast_type": "Tuple"}, "node_id": 13, "ast_type": "Subscript"}, "lineno": 2, "is_transient": false, "value": null, "is_constant": false, "col_offset": 0, "end_lineno": 2, "end_col_offset": 34, "src": "36:34:0", "is_immutable": false, "target": {"lineno": 2, "end_lineno": 2, "id": "my_dict", "col_offset": 0, "end_col_offset": 7, "src": "36:7:0", "node_id": 11, "ast_type": "Name", "type": {"key_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "value_type": {"name": "address"}, "name": "HashMap", "typeclass": "hashmap"}}, "node_id": 10, "ast_type": "VariableDecl", "type": {"key_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "value_type": {"name": "address"}, "name": "HashMap", "typeclass": "hashmap"}}, {"args": {"default": null, "args": [{"lineno": 5, "annotation": {"lineno": 5, "end_lineno": 5, "id": "int128", "col_offset": 29, "end_col_offset": 35, "src": "111:6:0", "node_id": 26, "ast_type": "Name"}, "end_lineno": 5, "col_offset": 21, "arg": "param1", "end_col_offset": 35, "src": "103:14:0", "node_id": 25, "ast_type": "arg"}, {"lineno": 5, "annotation": {"lineno": 5, "end_lineno": 5, "id": "bool", "col_offset": 45, "end_col_offset": 49, "src": "127:4:0", "node_id": 29, "ast_type": "Name"}, "end_lineno": 5, "col_offset": 37, "arg": "param2", "end_col_offset": 49, "src": "119:12:0", "node_id": 28, "ast_type": "arg"}], "lineno": 5, "defaults": [], "end_lineno": 26, "col_offset": 0, "end_col_offset": 32, "src": "82:736:0", "node_id": 24, "ast_type": "arguments"}, "pos": null, "returns": {"lineno": 5, "end_lineno": 5, "id": "bytes32", "col_offset": 54, "end_col_offset": 61, "src": "136:7:0", "node_id": 142, "ast_type": "Name"}, "end_lineno": 26, "name": "example_function", "col_offset": 0, "lineno": 5, "end_col_offset": 32, "decorator_list": [{"lineno": 4, "end_lineno": 4, "id": "external", "col_offset": 1, "end_col_offset": 9, "src": "73:8:0", "node_id": 140, "ast_type": "Name"}], "doc_string": null, "src": "82:736:0", "body": [{"lineno": 6, "annotation": {"lineno": 6, "end_lineno": 6, "value": {"lineno": 6, "end_lineno": 6, "id": "Bytes", "col_offset": 16, "end_col_offset": 21, "src": "161:5:0", "node_id": 35, "ast_type": "Name"}, "col_offset": 16, "end_col_offset": 25, "src": "161:9:0", "slice": {"lineno": 6, "end_lineno": 6, "value": 10, "col_offset": 22, "end_col_offset": 24, "src": "167:2:0", "node_id": 37, "ast_type": "Int"}, "node_id": 34, "ast_type": "Subscript"}, "end_lineno": 6, "value": {"lineno": 6, "end_lineno": 6, "value": "0x7679706572", "col_offset": 28, "end_col_offset": 36, "src": "173:8:0", "node_id": 39, "ast_type": "Bytes", "type": {"length": 10, "name": "Bytes", "typeclass": "bytes"}}, "col_offset": 4, "end_col_offset": 36, "src": "149:32:0", "target": {"lineno": 6, "end_lineno": 6, "id": "some_bytes", "col_offset": 4, "end_col_offset": 14, "src": "149:10:0", "node_id": 32, "ast_type": "Name", "type": {"length": 10, "name": "Bytes", "typeclass": "bytes"}, "variable_reads": [{"name": "some_bytes", "decl_node": {"node_id": 31, "source_id": 0}, "access_path": []}]}, "node_id": 31, "ast_type": "AnnAssign"}, {"lineno": 7, "annotation": {"lineno": 7, "end_lineno": 7, "id": "bytes32", "col_offset": 14, "end_col_offset": 21, "src": "196:7:0", "node_id": 43, "ast_type": "Name"}, "end_lineno": 7, "value": {"lineno": 7, "end_lineno": 7, "value": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "col_offset": 24, "end_col_offset": 90, "src": "206:66:0", "node_id": 45, "ast_type": "Hex", "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}}, "col_offset": 4, "end_col_offset": 90, "src": "186:86:0", "target": {"lineno": 7, "end_lineno": 7, "id": "some_hex", "col_offset": 4, "end_col_offset": 12, "src": "186:8:0", "node_id": 41, "ast_type": "Name", "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "some_hex", "decl_node": {"node_id": 40, "source_id": 0}, "access_path": []}]}, "node_id": 40, "ast_type": "AnnAssign"}, {"lineno": 8, "annotation": {"lineno": 8, "end_lineno": 8, "id": "int128", "col_offset": 12, "end_col_offset": 18, "src": "285:6:0", "node_id": 49, "ast_type": "Name"}, "end_lineno": 8, "value": {"right": {"lineno": 8, "end_lineno": 8, "value": 10, "col_offset": 30, "end_col_offset": 32, "src": "303:2:0", "node_id": 55, "ast_type": "Int", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}}, "lineno": 8, "end_lineno": 8, "col_offset": 21, "op": {"lineno": 8, "end_lineno": 8, "col_offset": 21, "end_col_offset": 32, "src": "294:11:0", "node_id": 54, "ast_type": "Add"}, "left": {"lineno": 8, "end_lineno": 8, "id": "param1", "col_offset": 21, "end_col_offset": 27, "src": "294:6:0", "node_id": 52, "ast_type": "Name", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}, "variable_reads": [{"name": "param1", "decl_node": {"node_id": 25, "source_id": 0}, "access_path": []}]}, "end_col_offset": 32, "src": "294:11:0", "node_id": 51, "ast_type": "BinOp", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}}, "col_offset": 4, "end_col_offset": 32, "src": "277:28:0", "target": {"lineno": 8, "end_lineno": 8, "id": "result", "col_offset": 4, "end_col_offset": 10, "src": "277:6:0", "node_id": 47, "ast_type": "Name", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}, "variable_reads": [{"name": "result", "decl_node": {"node_id": 46, "source_id": 0}, "access_path": []}]}, "node_id": 46, "ast_type": "AnnAssign"}, {"lineno": 9, "annotation": {"lineno": 9, "end_lineno": 9, "id": "bool", "col_offset": 15, "end_col_offset": 19, "src": "321:4:0", "node_id": 59, "ast_type": "Name"}, "end_lineno": 9, "value": {"lineno": 9, "end_lineno": 9, "col_offset": 22, "op": {"lineno": 9, "end_lineno": 9, "col_offset": 22, "end_col_offset": 43, "src": "328:21:0", "node_id": 62, "ast_type": "And"}, "end_col_offset": 43, "src": "328:21:0", "node_id": 61, "values": [{"right": {"lineno": 9, "end_lineno": 9, "value": 0, "col_offset": 31, "end_col_offset": 32, "src": "337:1:0", "node_id": 67, "ast_type": "Int", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}}, "lineno": 9, "end_lineno": 9, "col_offset": 22, "op": {"lineno": 9, "end_lineno": 9, "col_offset": 22, "end_col_offset": 32, "src": "328:10:0", "node_id": 66, "ast_type": "Gt"}, "left": {"lineno": 9, "end_lineno": 9, "id": "param1", "col_offset": 22, "end_col_offset": 28, "src": "328:6:0", "node_id": 64, "ast_type": "Name", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}, "variable_reads": [{"name": "param1", "decl_node": {"node_id": 25, "source_id": 0}, "access_path": []}]}, "end_col_offset": 32, "src": "328:10:0", "node_id": 63, "ast_type": "Compare", "type": {"name": "bool"}}, {"lineno": 9, "end_lineno": 9, "id": "param2", "col_offset": 37, "end_col_offset": 43, "src": "343:6:0", "node_id": 68, "ast_type": "Name", "type": {"name": "bool"}, "variable_reads": [{"name": "param2", "decl_node": {"node_id": 28, "source_id": 0}, "access_path": []}]}], "ast_type": "BoolOp", "type": {"name": "bool"}}, "col_offset": 4, "end_col_offset": 43, "src": "310:39:0", "target": {"lineno": 9, "end_lineno": 9, "id": "condition", "col_offset": 4, "end_col_offset": 13, "src": "310:9:0", "node_id": 57, "ast_type": "Name", "type": {"name": "bool"}, "variable_reads": [{"name": "condition", "decl_node": {"node_id": 56, "source_id": 0}, "access_path": []}]}, "node_id": 56, "ast_type": "AnnAssign"}, {"lineno": 10, "annotation": {"lineno": 10, "end_lineno": 10, "id": "int128", "col_offset": 14, "end_col_offset": 20, "src": "364:6:0", "node_id": 73, "ast_type": "Name"}, "end_lineno": 10, "value": {"lineno": 10, "end_lineno": 10, "col_offset": 23, "op": {"lineno": 10, "end_lineno": 10, "col_offset": 23, "end_col_offset": 30, "src": "373:7:0", "node_id": 76, "ast_type": "USub"}, "end_col_offset": 30, "src": "373:7:0", "operand": {"lineno": 10, "end_lineno": 10, "id": "param1", "col_offset": 24, "end_col_offset": 30, "src": "374:6:0", "node_id": 77, "ast_type": "Name", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}, "variable_reads": [{"name": "param1", "decl_node": {"node_id": 25, "source_id": 0}, "access_path": []}]}, "node_id": 75, "ast_type": "UnaryOp", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}}, "col_offset": 4, "end_col_offset": 30, "src": "354:26:0", "target": {"lineno": 10, "end_lineno": 10, "id": "negative", "col_offset": 4, "end_col_offset": 12, "src": "354:8:0", "node_id": 71, "ast_type": "Name", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}, "variable_reads": [{"name": "negative", "decl_node": {"node_id": 70, "source_id": 0}, "access_path": []}]}, "node_id": 70, "ast_type": "AnnAssign"}, {"lineno": 11, "annotation": {"lineno": 11, "end_lineno": 11, "id": "int128", "col_offset": 14, "end_col_offset": 20, "src": "395:6:0", "node_id": 82, "ast_type": "Name"}, "end_lineno": 11, "value": {"lineno": 11, "end_lineno": 11, "col_offset": 23, "op": {"lineno": 11, "end_lineno": 11, "col_offset": 23, "end_col_offset": 30, "src": "404:7:0", "node_id": 85, "ast_type": "Invert"}, "end_col_offset": 30, "src": "404:7:0", "operand": {"lineno": 11, "end_lineno": 11, "id": "param1", "col_offset": 24, "end_col_offset": 30, "src": "405:6:0", "node_id": 86, "ast_type": "Name", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}, "variable_reads": [{"name": "param1", "decl_node": {"node_id": 25, "source_id": 0}, "access_path": []}]}, "node_id": 84, "ast_type": "UnaryOp", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}}, "col_offset": 4, "end_col_offset": 30, "src": "385:26:0", "target": {"lineno": 11, "end_lineno": 11, "id": "inverted", "col_offset": 4, "end_col_offset": 12, "src": "385:8:0", "node_id": 80, "ast_type": "Name", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}, "variable_reads": [{"name": "inverted", "decl_node": {"node_id": 79, "source_id": 0}, "access_path": []}]}, "node_id": 79, "ast_type": "AnnAssign"}, {"lineno": 12, "annotation": {"lineno": 12, "end_lineno": 12, "id": "uint256", "col_offset": 11, "end_col_offset": 18, "src": "423:7:0", "node_id": 91, "ast_type": "Name"}, "end_lineno": 12, "value": {"test": {"lineno": 12, "end_lineno": 12, "id": "condition", "col_offset": 28, "end_col_offset": 37, "src": "440:9:0", "node_id": 94, "ast_type": "Name", "type": {"name": "bool"}, "variable_reads": [{"name": "condition", "decl_node": {"node_id": 56, "source_id": 0}, "access_path": []}]}, "lineno": 12, "end_lineno": 12, "col_offset": 21, "end_col_offset": 46, "src": "433:25:0", "body": {"lineno": 12, "end_lineno": 12, "value": 100, "col_offset": 21, "end_col_offset": 24, "src": "433:3:0", "node_id": 96, "ast_type": "Int", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "orelse": {"lineno": 12, "end_lineno": 12, "value": 200, "col_offset": 43, "end_col_offset": 46, "src": "455:3:0", "node_id": 97, "ast_type": "Int", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "node_id": 93, "ast_type": "IfExp", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "col_offset": 4, "end_col_offset": 46, "src": "416:42:0", "target": {"lineno": 12, "end_lineno": 12, "id": "value", "col_offset": 4, "end_col_offset": 9, "src": "416:5:0", "node_id": 89, "ast_type": "Name", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "value", "decl_node": {"node_id": 88, "source_id": 0}, "access_path": []}]}, "node_id": 88, "ast_type": "AnnAssign"}, {"lineno": 13, "annotation": {"lineno": 13, "end_lineno": 13, "value": {"lineno": 13, "end_lineno": 13, "id": "Bytes", "col_offset": 15, "end_col_offset": 20, "src": "474:5:0", "node_id": 102, "ast_type": "Name"}, "col_offset": 15, "end_col_offset": 24, "src": "474:9:0", "slice": {"lineno": 13, "end_lineno": 13, "value": 32, "col_offset": 21, "end_col_offset": 23, "src": "480:2:0", "node_id": 104, "ast_type": "Int"}, "node_id": 101, "ast_type": "Subscript"}, "end_lineno": 19, "value": {"func": {"lineno": 13, "end_lineno": 13, "id": "raw_call", "col_offset": 27, "end_col_offset": 35, "src": "486:8:0", "node_id": 107, "ast_type": "Name", "type": {"name": "raw_call", "typeclass": "builtin_function"}}, "args": [{"lineno": 14, "end_lineno": 14, "value": "0x1234567890123456789012345678901234567890", "col_offset": 8, "end_col_offset": 50, "src": "504:42:0", "node_id": 109, "ast_type": "Hex", "type": {"name": "address"}}, {"lineno": 15, "end_lineno": 15, "value": "0x", "col_offset": 8, "end_col_offset": 11, "src": "556:3:0", "node_id": 110, "ast_type": "Bytes", "type": {"length": 0, "name": "Bytes", "typeclass": "bytes"}}], "lineno": 13, "end_lineno": 19, "col_offset": 27, "end_col_offset": 5, "src": "486:139:0", "node_id": 106, "keywords": [{"lineno": 16, "end_lineno": 16, "value": {"lineno": 16, "end_lineno": 16, "value": 32, "col_offset": 20, "end_col_offset": 22, "src": "581:2:0", "node_id": 112, "ast_type": "Int", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "col_offset": 8, "arg": "max_outsize", "end_col_offset": 22, "src": "569:14:0", "node_id": 111, "ast_type": "keyword"}, {"lineno": 17, "end_lineno": 17, "value": {"lineno": 17, "end_lineno": 17, "value": 0, "col_offset": 14, "end_col_offset": 15, "src": "599:1:0", "node_id": 114, "ast_type": "Int", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "col_offset": 8, "arg": "value", "end_col_offset": 15, "src": "593:7:0", "node_id": 113, "ast_type": "keyword"}, {"lineno": 18, "end_lineno": 18, "value": {"lineno": 18, "end_lineno": 18, "value": 10000, "col_offset": 12, "end_col_offset": 17, "src": "614:5:0", "node_id": 116, "ast_type": "Int", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "col_offset": 8, "arg": "gas", "end_col_offset": 17, "src": "610:9:0", "node_id": 115, "ast_type": "keyword"}], "ast_type": "Call", "type": {"length": 32, "name": "Bytes", "typeclass": "bytes"}}, "col_offset": 4, "end_col_offset": 5, "src": "463:162:0", "target": {"lineno": 13, "end_lineno": 13, "id": "response1", "col_offset": 4, "end_col_offset": 13, "src": "463:9:0", "node_id": 99, "ast_type": "Name", "type": {"length": 32, "name": "Bytes", "typeclass": "bytes"}, "variable_reads": [{"name": "response1", "decl_node": {"node_id": 98, "source_id": 0}, "access_path": []}]}, "node_id": 98, "ast_type": "AnnAssign"}, {"lineno": 20, "annotation": {"lineno": 20, "end_lineno": 20, "value": {"lineno": 20, "end_lineno": 20, "id": "Bytes", "col_offset": 15, "end_col_offset": 20, "src": "641:5:0", "node_id": 121, "ast_type": "Name"}, "col_offset": 15, "end_col_offset": 24, "src": "641:9:0", "slice": {"lineno": 20, "end_lineno": 20, "value": 32, "col_offset": 21, "end_col_offset": 23, "src": "647:2:0", "node_id": 123, "ast_type": "Int"}, "node_id": 120, "ast_type": "Subscript"}, "end_lineno": 25, "value": {"func": {"lineno": 20, "end_lineno": 20, "id": "raw_call", "col_offset": 27, "end_col_offset": 35, "src": "653:8:0", "node_id": 126, "ast_type": "Name", "type": {"name": "raw_call", "typeclass": "builtin_function"}}, "args": [{"lineno": 21, "end_lineno": 21, "value": "0x1234567890123456789012345678901234567890", "col_offset": 8, "end_col_offset": 50, "src": "671:42:0", "node_id": 128, "ast_type": "Hex", "type": {"name": "address"}}, {"lineno": 22, "end_lineno": 22, "value": "0x", "col_offset": 8, "end_col_offset": 11, "src": "723:3:0", "node_id": 129, "ast_type": "Bytes", "type": {"length": 0, "name": "Bytes", "typeclass": "bytes"}}], "lineno": 20, "end_lineno": 25, "col_offset": 27, "end_col_offset": 5, "src": "653:132:0", "node_id": 125, "keywords": [{"lineno": 23, "end_lineno": 23, "value": {"lineno": 23, "end_lineno": 23, "value": 32, "col_offset": 20, "end_col_offset": 22, "src": "748:2:0", "node_id": 131, "ast_type": "Int", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "col_offset": 8, "arg": "max_outsize", "end_col_offset": 22, "src": "736:14:0", "node_id": 130, "ast_type": "keyword"}, {"lineno": 24, "end_lineno": 24, "value": {"lineno": 24, "end_lineno": 24, "value": true, "col_offset": 23, "end_col_offset": 27, "src": "775:4:0", "node_id": 133, "ast_type": "NameConstant", "type": {"name": "bool"}}, "col_offset": 8, "arg": "is_static_call", "end_col_offset": 27, "src": "760:19:0", "node_id": 132, "ast_type": "keyword"}], "ast_type": "Call", "type": {"length": 32, "name": "Bytes", "typeclass": "bytes"}}, "col_offset": 4, "end_col_offset": 5, "src": "630:155:0", "target": {"lineno": 20, "end_lineno": 20, "id": "response2", "col_offset": 4, "end_col_offset": 13, "src": "630:9:0", "node_id": 118, "ast_type": "Name", "type": {"length": 32, "name": "Bytes", "typeclass": "bytes"}, "variable_reads": [{"name": "response2", "decl_node": {"node_id": 117, "source_id": 0}, "access_path": []}]}, "node_id": 117, "ast_type": "AnnAssign"}, {"lineno": 26, "end_lineno": 26, "value": {"func": {"lineno": 26, "end_lineno": 26, "id": "keccak256", "col_offset": 11, "end_col_offset": 20, "src": "797:9:0", "node_id": 136, "ast_type": "Name", "type": {"name": "keccak256", "typeclass": "builtin_function"}}, "args": [{"lineno": 26, "end_lineno": 26, "id": "some_bytes", "col_offset": 21, "end_col_offset": 31, "src": "807:10:0", "node_id": 138, "ast_type": "Name", "type": {"length": 10, "name": "Bytes", "typeclass": "bytes"}, "variable_reads": [{"name": "some_bytes", "decl_node": {"node_id": 31, "source_id": 0}, "access_path": []}]}], "lineno": 26, "end_lineno": 26, "col_offset": 11, "end_col_offset": 32, "src": "797:21:0", "node_id": 135, "keywords": [], "ast_type": "Call", "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}}, "col_offset": 4, "end_col_offset": 32, "src": "790:28:0", "node_id": 134, "ast_type": "Return"}], "node_id": 23, "ast_type": "FunctionDef"}], "source_id": 0, "node_id": 0, "is_interface": false, "ast_type": "Module", "type": {"name": "types.vy", "type_decl_node": {"node_id": 0, "source_id": 0}, "typeclass": "module"}} \ No newline at end of file diff --git a/test-data/vyper_ast/uses.json b/test-data/vyper_ast/uses.json new file mode 100644 index 000000000..720fe7b18 --- /dev/null +++ b/test-data/vyper_ast/uses.json @@ -0,0 +1 @@ +{"source_sha256sum": "aadea8b2a09a01756f139ba8c14ae6e1710a2f2822716fd75646b9fdb6cc9e1d", "path": "uses.vy", "resolved_path": "/tmp/vyper_samples/uses.vy", "name": null, "is_interface": false, "src": "0:61:0", "end_col_offset": 23, "body": [{"name": "ownable", "src": "0:21:0", "end_col_offset": 21, "end_lineno": 1, "level": 1, "node_id": 1, "lineno": 1, "col_offset": 0, "alias": null, "module": null, "ast_type": "ImportFrom", "import_info": {"alias": "ownable", "qualified_module_name": "ownable", "source_id": 1, "path": "ownable.vy", "resolved_path": "/tmp/vyper_samples/ownable.vy", "file_sha256sum": "e275d6c33ee4a73392fe396eef2c2695b2a90d802aa6ba2a20f26ed5fb4a7bbe"}}, {"src": "23:13:0", "end_col_offset": 13, "node_id": 3, "lineno": 3, "col_offset": 0, "annotation": {"id": "ownable", "src": "29:7:0", "end_col_offset": 13, "node_id": 6, "lineno": 3, "col_offset": 6, "ast_type": "Name", "end_lineno": 3}, "ast_type": "UsesDecl", "end_lineno": 3}, {"src": "38:22:0", "end_col_offset": 22, "node_id": 8, "lineno": 5, "col_offset": 0, "annotation": {"value": {"id": "ownable", "src": "47:7:0", "end_col_offset": 16, "node_id": 12, "lineno": 5, "col_offset": 9, "ast_type": "Name", "end_lineno": 5}, "src": "47:13:0", "end_col_offset": 22, "node_id": 11, "lineno": 5, "col_offset": 9, "attr": "owner", "ast_type": "Attribute", "end_lineno": 5}, "ast_type": "ExportsDecl", "end_lineno": 5}], "settings": {}, "source_id": 0, "node_id": 0, "lineno": 1, "col_offset": 0, "ast_type": "Module", "doc_string": null, "end_lineno": 5, "type": {"name": "uses.vy", "type_decl_node": {"node_id": 0, "source_id": 0}, "typeclass": "module"}} \ No newline at end of file From 4f51153b67cbf3f430457cf65b29461c730a1d75 Mon Sep 17 00:00:00 2001 From: francois Date: Fri, 25 Jul 2025 23:16:46 +0700 Subject: [PATCH 05/11] add test for the Ellipsis type --- test-data/vyper_ast/interface.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 test-data/vyper_ast/interface.json diff --git a/test-data/vyper_ast/interface.json b/test-data/vyper_ast/interface.json new file mode 100644 index 000000000..40f0b74f9 --- /dev/null +++ b/test-data/vyper_ast/interface.json @@ -0,0 +1 @@ +{"source_sha256sum": "dfa22b78ba297868f2c59e7afd5a70536a8b9ec908a18b75157951b22cf8d2ee", "doc_string": null, "name": null, "path": "interface.vyi", "end_lineno": 4, "settings": {}, "col_offset": 0, "end_col_offset": 8, "ast_type": "Module", "node_id": 0, "is_interface": true, "src": "0:62:0", "lineno": 1, "body": [{"doc_string": null, "name": "delegated", "end_lineno": 4, "decorator_list": [{"end_lineno": 1, "col_offset": 1, "end_col_offset": 5, "ast_type": "Name", "node_id": 8, "src": "1:4:0", "lineno": 1, "id": "view"}, {"end_lineno": 2, "col_offset": 1, "end_col_offset": 9, "ast_type": "Name", "node_id": 10, "src": "7:8:0", "lineno": 2, "id": "external"}], "col_offset": 0, "end_col_offset": 7, "ast_type": "FunctionDef", "node_id": 1, "src": "16:45:0", "args": {"end_lineno": 4, "default": null, "col_offset": 0, "end_col_offset": 7, "ast_type": "arguments", "node_id": 2, "src": "16:45:0", "args": [{"end_lineno": 3, "col_offset": 14, "end_col_offset": 27, "ast_type": "arg", "node_id": 3, "src": "30:13:0", "arg": "addr", "annotation": {"end_lineno": 3, "col_offset": 20, "end_col_offset": 27, "ast_type": "Name", "node_id": 4, "src": "36:7:0", "lineno": 3, "id": "address"}, "lineno": 3}], "defaults": [], "lineno": 3}, "lineno": 3, "body": [{"end_lineno": 4, "col_offset": 4, "end_col_offset": 7, "ast_type": "Expr", "node_id": 6, "src": "58:3:0", "value": {"end_lineno": 4, "col_offset": 4, "end_col_offset": 7, "ast_type": "Ellipsis", "node_id": 7, "src": "58:3:0", "value": "...", "lineno": 4}, "lineno": 4}], "pos": null, "returns": {"end_lineno": 3, "col_offset": 32, "end_col_offset": 36, "ast_type": "Name", "node_id": 12, "src": "48:4:0", "lineno": 3, "id": "bool"}}], "source_id": 0, "resolved_path": "/tmp/vyper_samples/interface.vyi", "type": {"name": "interface.vyi", "type_decl_node": {"node_id": 0, "source_id": 0}, "typeclass": "module"}} \ No newline at end of file From caf09a9f4ad3da48ab0bc5940a6e16293082066e Mon Sep 17 00:00:00 2001 From: francois Date: Sat, 26 Jul 2025 10:15:36 +0700 Subject: [PATCH 06/11] add missing types --- crates/artifacts/vyper/src/ast/mod.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/crates/artifacts/vyper/src/ast/mod.rs b/crates/artifacts/vyper/src/ast/mod.rs index ecb320b56..71f1f1c4e 100644 --- a/crates/artifacts/vyper/src/ast/mod.rs +++ b/crates/artifacts/vyper/src/ast/mod.rs @@ -386,8 +386,12 @@ vyper_node!( ); vyper_node!( - struct Ellipsis {} -); // TODO + struct Ellipsis { + value: String, + #[serde(rename = "type")] + ttype: Option, + } +); vyper_node!( struct List { @@ -404,8 +408,11 @@ vyper_node!( ); vyper_node!( - struct Dict {} -); // TODO + struct Dict { + keys: Vec, + values: Vec, + } +); vyper_node!( struct Name { From 9c01a461088ffdec19c968fdc1722129667d9820 Mon Sep 17 00:00:00 2001 From: francois Date: Sat, 26 Jul 2025 10:42:47 +0700 Subject: [PATCH 07/11] add Dict test data and rewrite basic nodes --- crates/artifacts/vyper/src/ast/macros.rs | 19 ++++- crates/artifacts/vyper/src/ast/mod.rs | 95 +++--------------------- test-data/vyper_ast/types.json | 2 +- 3 files changed, 31 insertions(+), 85 deletions(-) diff --git a/crates/artifacts/vyper/src/ast/macros.rs b/crates/artifacts/vyper/src/ast/macros.rs index ef8cefee9..adbeb5f31 100644 --- a/crates/artifacts/vyper/src/ast/macros.rs +++ b/crates/artifacts/vyper/src/ast/macros.rs @@ -25,6 +25,22 @@ macro_rules! vyper_node { }; } +macro_rules! basic_vyper_nodes { + ( + $( + $(#[$struct_meta:meta])* + $name:ident + ),* $(,)? + ) => { + $( + vyper_node! { + $(#[$struct_meta])* + struct $name {} + } + )* + } +} + macro_rules! node_group { ( $group:ident; @@ -45,5 +61,6 @@ macro_rules! node_group { }; } -pub(crate) use node_group; pub(crate) use vyper_node; +pub(crate) use basic_vyper_nodes; +pub(crate) use node_group; diff --git a/crates/artifacts/vyper/src/ast/mod.rs b/crates/artifacts/vyper/src/ast/mod.rs index 71f1f1c4e..d25cda910 100644 --- a/crates/artifacts/vyper/src/ast/mod.rs +++ b/crates/artifacts/vyper/src/ast/mod.rs @@ -3,20 +3,20 @@ use serde::{Deserialize, Serialize}; mod macros; pub mod visitor; -use crate::ast::macros::node_group; +use crate::ast::macros::{basic_vyper_nodes, node_group}; use macros::vyper_node; vyper_node!( struct Module { // Module-specific fields - source_sha256sum: String, + source_sha256sum: Option, name: Option, - path: String, - resolved_path: String, - source_id: i32, - is_interface: bool, + path: Option, + resolved_path: Option, + source_id: Option, + is_interface: Option, doc_string: Option, - settings: Settings, + settings: Option, // AST content body: Vec, @@ -548,16 +548,8 @@ node_group!( Invert, ); -vyper_node!( - struct USub {} -); - -vyper_node!( - struct Not {} -); - -vyper_node!( - struct Invert {} +basic_vyper_nodes!( + USub, Not, Invert ); node_group!( @@ -580,42 +572,7 @@ node_group!( RShift, ); -vyper_node!( - struct Add {} -); -vyper_node!( - struct Sub {} -); -vyper_node!( - struct Mult {} -); -vyper_node!( - struct Div {} -); -vyper_node!( - struct FloorDiv {} -); -vyper_node!( - struct Mod {} -); -vyper_node!( - struct Pow {} -); -vyper_node!( - struct BitAnd {} -); -vyper_node!( - struct BitOr {} -); -vyper_node!( - struct BitXor {} -); -vyper_node!( - struct LShift {} -); -vyper_node!( - struct RShift {} -); +basic_vyper_nodes!(Add, Sub, Mult, Div, FloorDiv, Mod, Pow, BitAnd, BitOr, BitXor, LShift, RShift); node_group!( BooleanOperator; @@ -624,12 +581,7 @@ node_group!( Or, ); -vyper_node!( - struct And {} -); -vyper_node!( - struct Or {} -); +basic_vyper_nodes!(And, Or); node_group!( ComparisonOperator; @@ -644,30 +596,7 @@ node_group!( NotIn, ); -vyper_node!( - struct Eq {} -); -vyper_node!( - struct NotEq {} -); -vyper_node!( - struct Lt {} -); -vyper_node!( - struct LtE {} -); -vyper_node!( - struct Gt {} -); -vyper_node!( - struct GtE {} -); -vyper_node!( - struct In {} -); -vyper_node!( - struct NotIn {} -); +basic_vyper_nodes!(Eq, NotEq, Lt, LtE, Gt, GtE, In, NotIn); #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct Settings {} diff --git a/test-data/vyper_ast/types.json b/test-data/vyper_ast/types.json index 4e2fe7881..238fc2990 100644 --- a/test-data/vyper_ast/types.json +++ b/test-data/vyper_ast/types.json @@ -1 +1 @@ -{"source_sha256sum": "db06ae2a677efa06b28e806b0dc9b81b41dee5c298353f6d9eb7bd9d78cfbce1", "lineno": 1, "path": "types.vy", "name": null, "settings": {}, "col_offset": 0, "end_lineno": 26, "end_col_offset": 33, "doc_string": null, "src": "0:819:0", "resolved_path": "/tmp/vyper_samples/types.vy", "body": [{"is_reentrant": false, "is_public": false, "annotation": {"lineno": 1, "end_lineno": 1, "id": "uint256", "col_offset": 22, "end_col_offset": 29, "src": "22:7:0", "node_id": 7, "ast_type": "Name"}, "lineno": 1, "is_transient": false, "value": {"lineno": 1, "end_lineno": 1, "value": 42, "col_offset": 33, "end_col_offset": 35, "src": "33:2:0", "node_id": 9, "ast_type": "Int", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "is_constant": true, "col_offset": 0, "end_lineno": 1, "end_col_offset": 35, "src": "0:35:0", "is_immutable": false, "target": {"lineno": 1, "end_lineno": 1, "id": "MY_CONSTANT", "col_offset": 0, "end_col_offset": 11, "src": "0:11:0", "node_id": 2, "ast_type": "Name"}, "node_id": 1, "ast_type": "VariableDecl", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, {"is_reentrant": false, "is_public": false, "annotation": {"lineno": 2, "end_lineno": 2, "value": {"lineno": 2, "end_lineno": 2, "id": "HashMap", "col_offset": 9, "end_col_offset": 16, "src": "45:7:0", "node_id": 14, "ast_type": "Name"}, "col_offset": 9, "end_col_offset": 34, "src": "45:25:0", "slice": {"lineno": 2, "end_lineno": 2, "col_offset": 17, "end_col_offset": 33, "src": "53:16:0", "elements": [{"lineno": 2, "end_lineno": 2, "id": "uint256", "col_offset": 17, "end_col_offset": 24, "src": "53:7:0", "node_id": 17, "ast_type": "Name"}, {"lineno": 2, "end_lineno": 2, "id": "address", "col_offset": 26, "end_col_offset": 33, "src": "62:7:0", "node_id": 19, "ast_type": "Name"}], "node_id": 16, "ast_type": "Tuple"}, "node_id": 13, "ast_type": "Subscript"}, "lineno": 2, "is_transient": false, "value": null, "is_constant": false, "col_offset": 0, "end_lineno": 2, "end_col_offset": 34, "src": "36:34:0", "is_immutable": false, "target": {"lineno": 2, "end_lineno": 2, "id": "my_dict", "col_offset": 0, "end_col_offset": 7, "src": "36:7:0", "node_id": 11, "ast_type": "Name", "type": {"key_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "value_type": {"name": "address"}, "name": "HashMap", "typeclass": "hashmap"}}, "node_id": 10, "ast_type": "VariableDecl", "type": {"key_type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "value_type": {"name": "address"}, "name": "HashMap", "typeclass": "hashmap"}}, {"args": {"default": null, "args": [{"lineno": 5, "annotation": {"lineno": 5, "end_lineno": 5, "id": "int128", "col_offset": 29, "end_col_offset": 35, "src": "111:6:0", "node_id": 26, "ast_type": "Name"}, "end_lineno": 5, "col_offset": 21, "arg": "param1", "end_col_offset": 35, "src": "103:14:0", "node_id": 25, "ast_type": "arg"}, {"lineno": 5, "annotation": {"lineno": 5, "end_lineno": 5, "id": "bool", "col_offset": 45, "end_col_offset": 49, "src": "127:4:0", "node_id": 29, "ast_type": "Name"}, "end_lineno": 5, "col_offset": 37, "arg": "param2", "end_col_offset": 49, "src": "119:12:0", "node_id": 28, "ast_type": "arg"}], "lineno": 5, "defaults": [], "end_lineno": 26, "col_offset": 0, "end_col_offset": 32, "src": "82:736:0", "node_id": 24, "ast_type": "arguments"}, "pos": null, "returns": {"lineno": 5, "end_lineno": 5, "id": "bytes32", "col_offset": 54, "end_col_offset": 61, "src": "136:7:0", "node_id": 142, "ast_type": "Name"}, "end_lineno": 26, "name": "example_function", "col_offset": 0, "lineno": 5, "end_col_offset": 32, "decorator_list": [{"lineno": 4, "end_lineno": 4, "id": "external", "col_offset": 1, "end_col_offset": 9, "src": "73:8:0", "node_id": 140, "ast_type": "Name"}], "doc_string": null, "src": "82:736:0", "body": [{"lineno": 6, "annotation": {"lineno": 6, "end_lineno": 6, "value": {"lineno": 6, "end_lineno": 6, "id": "Bytes", "col_offset": 16, "end_col_offset": 21, "src": "161:5:0", "node_id": 35, "ast_type": "Name"}, "col_offset": 16, "end_col_offset": 25, "src": "161:9:0", "slice": {"lineno": 6, "end_lineno": 6, "value": 10, "col_offset": 22, "end_col_offset": 24, "src": "167:2:0", "node_id": 37, "ast_type": "Int"}, "node_id": 34, "ast_type": "Subscript"}, "end_lineno": 6, "value": {"lineno": 6, "end_lineno": 6, "value": "0x7679706572", "col_offset": 28, "end_col_offset": 36, "src": "173:8:0", "node_id": 39, "ast_type": "Bytes", "type": {"length": 10, "name": "Bytes", "typeclass": "bytes"}}, "col_offset": 4, "end_col_offset": 36, "src": "149:32:0", "target": {"lineno": 6, "end_lineno": 6, "id": "some_bytes", "col_offset": 4, "end_col_offset": 14, "src": "149:10:0", "node_id": 32, "ast_type": "Name", "type": {"length": 10, "name": "Bytes", "typeclass": "bytes"}, "variable_reads": [{"name": "some_bytes", "decl_node": {"node_id": 31, "source_id": 0}, "access_path": []}]}, "node_id": 31, "ast_type": "AnnAssign"}, {"lineno": 7, "annotation": {"lineno": 7, "end_lineno": 7, "id": "bytes32", "col_offset": 14, "end_col_offset": 21, "src": "196:7:0", "node_id": 43, "ast_type": "Name"}, "end_lineno": 7, "value": {"lineno": 7, "end_lineno": 7, "value": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "col_offset": 24, "end_col_offset": 90, "src": "206:66:0", "node_id": 45, "ast_type": "Hex", "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}}, "col_offset": 4, "end_col_offset": 90, "src": "186:86:0", "target": {"lineno": 7, "end_lineno": 7, "id": "some_hex", "col_offset": 4, "end_col_offset": 12, "src": "186:8:0", "node_id": 41, "ast_type": "Name", "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}, "variable_reads": [{"name": "some_hex", "decl_node": {"node_id": 40, "source_id": 0}, "access_path": []}]}, "node_id": 40, "ast_type": "AnnAssign"}, {"lineno": 8, "annotation": {"lineno": 8, "end_lineno": 8, "id": "int128", "col_offset": 12, "end_col_offset": 18, "src": "285:6:0", "node_id": 49, "ast_type": "Name"}, "end_lineno": 8, "value": {"right": {"lineno": 8, "end_lineno": 8, "value": 10, "col_offset": 30, "end_col_offset": 32, "src": "303:2:0", "node_id": 55, "ast_type": "Int", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}}, "lineno": 8, "end_lineno": 8, "col_offset": 21, "op": {"lineno": 8, "end_lineno": 8, "col_offset": 21, "end_col_offset": 32, "src": "294:11:0", "node_id": 54, "ast_type": "Add"}, "left": {"lineno": 8, "end_lineno": 8, "id": "param1", "col_offset": 21, "end_col_offset": 27, "src": "294:6:0", "node_id": 52, "ast_type": "Name", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}, "variable_reads": [{"name": "param1", "decl_node": {"node_id": 25, "source_id": 0}, "access_path": []}]}, "end_col_offset": 32, "src": "294:11:0", "node_id": 51, "ast_type": "BinOp", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}}, "col_offset": 4, "end_col_offset": 32, "src": "277:28:0", "target": {"lineno": 8, "end_lineno": 8, "id": "result", "col_offset": 4, "end_col_offset": 10, "src": "277:6:0", "node_id": 47, "ast_type": "Name", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}, "variable_reads": [{"name": "result", "decl_node": {"node_id": 46, "source_id": 0}, "access_path": []}]}, "node_id": 46, "ast_type": "AnnAssign"}, {"lineno": 9, "annotation": {"lineno": 9, "end_lineno": 9, "id": "bool", "col_offset": 15, "end_col_offset": 19, "src": "321:4:0", "node_id": 59, "ast_type": "Name"}, "end_lineno": 9, "value": {"lineno": 9, "end_lineno": 9, "col_offset": 22, "op": {"lineno": 9, "end_lineno": 9, "col_offset": 22, "end_col_offset": 43, "src": "328:21:0", "node_id": 62, "ast_type": "And"}, "end_col_offset": 43, "src": "328:21:0", "node_id": 61, "values": [{"right": {"lineno": 9, "end_lineno": 9, "value": 0, "col_offset": 31, "end_col_offset": 32, "src": "337:1:0", "node_id": 67, "ast_type": "Int", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}}, "lineno": 9, "end_lineno": 9, "col_offset": 22, "op": {"lineno": 9, "end_lineno": 9, "col_offset": 22, "end_col_offset": 32, "src": "328:10:0", "node_id": 66, "ast_type": "Gt"}, "left": {"lineno": 9, "end_lineno": 9, "id": "param1", "col_offset": 22, "end_col_offset": 28, "src": "328:6:0", "node_id": 64, "ast_type": "Name", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}, "variable_reads": [{"name": "param1", "decl_node": {"node_id": 25, "source_id": 0}, "access_path": []}]}, "end_col_offset": 32, "src": "328:10:0", "node_id": 63, "ast_type": "Compare", "type": {"name": "bool"}}, {"lineno": 9, "end_lineno": 9, "id": "param2", "col_offset": 37, "end_col_offset": 43, "src": "343:6:0", "node_id": 68, "ast_type": "Name", "type": {"name": "bool"}, "variable_reads": [{"name": "param2", "decl_node": {"node_id": 28, "source_id": 0}, "access_path": []}]}], "ast_type": "BoolOp", "type": {"name": "bool"}}, "col_offset": 4, "end_col_offset": 43, "src": "310:39:0", "target": {"lineno": 9, "end_lineno": 9, "id": "condition", "col_offset": 4, "end_col_offset": 13, "src": "310:9:0", "node_id": 57, "ast_type": "Name", "type": {"name": "bool"}, "variable_reads": [{"name": "condition", "decl_node": {"node_id": 56, "source_id": 0}, "access_path": []}]}, "node_id": 56, "ast_type": "AnnAssign"}, {"lineno": 10, "annotation": {"lineno": 10, "end_lineno": 10, "id": "int128", "col_offset": 14, "end_col_offset": 20, "src": "364:6:0", "node_id": 73, "ast_type": "Name"}, "end_lineno": 10, "value": {"lineno": 10, "end_lineno": 10, "col_offset": 23, "op": {"lineno": 10, "end_lineno": 10, "col_offset": 23, "end_col_offset": 30, "src": "373:7:0", "node_id": 76, "ast_type": "USub"}, "end_col_offset": 30, "src": "373:7:0", "operand": {"lineno": 10, "end_lineno": 10, "id": "param1", "col_offset": 24, "end_col_offset": 30, "src": "374:6:0", "node_id": 77, "ast_type": "Name", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}, "variable_reads": [{"name": "param1", "decl_node": {"node_id": 25, "source_id": 0}, "access_path": []}]}, "node_id": 75, "ast_type": "UnaryOp", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}}, "col_offset": 4, "end_col_offset": 30, "src": "354:26:0", "target": {"lineno": 10, "end_lineno": 10, "id": "negative", "col_offset": 4, "end_col_offset": 12, "src": "354:8:0", "node_id": 71, "ast_type": "Name", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}, "variable_reads": [{"name": "negative", "decl_node": {"node_id": 70, "source_id": 0}, "access_path": []}]}, "node_id": 70, "ast_type": "AnnAssign"}, {"lineno": 11, "annotation": {"lineno": 11, "end_lineno": 11, "id": "int128", "col_offset": 14, "end_col_offset": 20, "src": "395:6:0", "node_id": 82, "ast_type": "Name"}, "end_lineno": 11, "value": {"lineno": 11, "end_lineno": 11, "col_offset": 23, "op": {"lineno": 11, "end_lineno": 11, "col_offset": 23, "end_col_offset": 30, "src": "404:7:0", "node_id": 85, "ast_type": "Invert"}, "end_col_offset": 30, "src": "404:7:0", "operand": {"lineno": 11, "end_lineno": 11, "id": "param1", "col_offset": 24, "end_col_offset": 30, "src": "405:6:0", "node_id": 86, "ast_type": "Name", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}, "variable_reads": [{"name": "param1", "decl_node": {"node_id": 25, "source_id": 0}, "access_path": []}]}, "node_id": 84, "ast_type": "UnaryOp", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}}, "col_offset": 4, "end_col_offset": 30, "src": "385:26:0", "target": {"lineno": 11, "end_lineno": 11, "id": "inverted", "col_offset": 4, "end_col_offset": 12, "src": "385:8:0", "node_id": 80, "ast_type": "Name", "type": {"is_signed": true, "bits": 128, "name": "int128", "typeclass": "integer"}, "variable_reads": [{"name": "inverted", "decl_node": {"node_id": 79, "source_id": 0}, "access_path": []}]}, "node_id": 79, "ast_type": "AnnAssign"}, {"lineno": 12, "annotation": {"lineno": 12, "end_lineno": 12, "id": "uint256", "col_offset": 11, "end_col_offset": 18, "src": "423:7:0", "node_id": 91, "ast_type": "Name"}, "end_lineno": 12, "value": {"test": {"lineno": 12, "end_lineno": 12, "id": "condition", "col_offset": 28, "end_col_offset": 37, "src": "440:9:0", "node_id": 94, "ast_type": "Name", "type": {"name": "bool"}, "variable_reads": [{"name": "condition", "decl_node": {"node_id": 56, "source_id": 0}, "access_path": []}]}, "lineno": 12, "end_lineno": 12, "col_offset": 21, "end_col_offset": 46, "src": "433:25:0", "body": {"lineno": 12, "end_lineno": 12, "value": 100, "col_offset": 21, "end_col_offset": 24, "src": "433:3:0", "node_id": 96, "ast_type": "Int", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "orelse": {"lineno": 12, "end_lineno": 12, "value": 200, "col_offset": 43, "end_col_offset": 46, "src": "455:3:0", "node_id": 97, "ast_type": "Int", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "node_id": 93, "ast_type": "IfExp", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "col_offset": 4, "end_col_offset": 46, "src": "416:42:0", "target": {"lineno": 12, "end_lineno": 12, "id": "value", "col_offset": 4, "end_col_offset": 9, "src": "416:5:0", "node_id": 89, "ast_type": "Name", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "value", "decl_node": {"node_id": 88, "source_id": 0}, "access_path": []}]}, "node_id": 88, "ast_type": "AnnAssign"}, {"lineno": 13, "annotation": {"lineno": 13, "end_lineno": 13, "value": {"lineno": 13, "end_lineno": 13, "id": "Bytes", "col_offset": 15, "end_col_offset": 20, "src": "474:5:0", "node_id": 102, "ast_type": "Name"}, "col_offset": 15, "end_col_offset": 24, "src": "474:9:0", "slice": {"lineno": 13, "end_lineno": 13, "value": 32, "col_offset": 21, "end_col_offset": 23, "src": "480:2:0", "node_id": 104, "ast_type": "Int"}, "node_id": 101, "ast_type": "Subscript"}, "end_lineno": 19, "value": {"func": {"lineno": 13, "end_lineno": 13, "id": "raw_call", "col_offset": 27, "end_col_offset": 35, "src": "486:8:0", "node_id": 107, "ast_type": "Name", "type": {"name": "raw_call", "typeclass": "builtin_function"}}, "args": [{"lineno": 14, "end_lineno": 14, "value": "0x1234567890123456789012345678901234567890", "col_offset": 8, "end_col_offset": 50, "src": "504:42:0", "node_id": 109, "ast_type": "Hex", "type": {"name": "address"}}, {"lineno": 15, "end_lineno": 15, "value": "0x", "col_offset": 8, "end_col_offset": 11, "src": "556:3:0", "node_id": 110, "ast_type": "Bytes", "type": {"length": 0, "name": "Bytes", "typeclass": "bytes"}}], "lineno": 13, "end_lineno": 19, "col_offset": 27, "end_col_offset": 5, "src": "486:139:0", "node_id": 106, "keywords": [{"lineno": 16, "end_lineno": 16, "value": {"lineno": 16, "end_lineno": 16, "value": 32, "col_offset": 20, "end_col_offset": 22, "src": "581:2:0", "node_id": 112, "ast_type": "Int", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "col_offset": 8, "arg": "max_outsize", "end_col_offset": 22, "src": "569:14:0", "node_id": 111, "ast_type": "keyword"}, {"lineno": 17, "end_lineno": 17, "value": {"lineno": 17, "end_lineno": 17, "value": 0, "col_offset": 14, "end_col_offset": 15, "src": "599:1:0", "node_id": 114, "ast_type": "Int", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "col_offset": 8, "arg": "value", "end_col_offset": 15, "src": "593:7:0", "node_id": 113, "ast_type": "keyword"}, {"lineno": 18, "end_lineno": 18, "value": {"lineno": 18, "end_lineno": 18, "value": 10000, "col_offset": 12, "end_col_offset": 17, "src": "614:5:0", "node_id": 116, "ast_type": "Int", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "col_offset": 8, "arg": "gas", "end_col_offset": 17, "src": "610:9:0", "node_id": 115, "ast_type": "keyword"}], "ast_type": "Call", "type": {"length": 32, "name": "Bytes", "typeclass": "bytes"}}, "col_offset": 4, "end_col_offset": 5, "src": "463:162:0", "target": {"lineno": 13, "end_lineno": 13, "id": "response1", "col_offset": 4, "end_col_offset": 13, "src": "463:9:0", "node_id": 99, "ast_type": "Name", "type": {"length": 32, "name": "Bytes", "typeclass": "bytes"}, "variable_reads": [{"name": "response1", "decl_node": {"node_id": 98, "source_id": 0}, "access_path": []}]}, "node_id": 98, "ast_type": "AnnAssign"}, {"lineno": 20, "annotation": {"lineno": 20, "end_lineno": 20, "value": {"lineno": 20, "end_lineno": 20, "id": "Bytes", "col_offset": 15, "end_col_offset": 20, "src": "641:5:0", "node_id": 121, "ast_type": "Name"}, "col_offset": 15, "end_col_offset": 24, "src": "641:9:0", "slice": {"lineno": 20, "end_lineno": 20, "value": 32, "col_offset": 21, "end_col_offset": 23, "src": "647:2:0", "node_id": 123, "ast_type": "Int"}, "node_id": 120, "ast_type": "Subscript"}, "end_lineno": 25, "value": {"func": {"lineno": 20, "end_lineno": 20, "id": "raw_call", "col_offset": 27, "end_col_offset": 35, "src": "653:8:0", "node_id": 126, "ast_type": "Name", "type": {"name": "raw_call", "typeclass": "builtin_function"}}, "args": [{"lineno": 21, "end_lineno": 21, "value": "0x1234567890123456789012345678901234567890", "col_offset": 8, "end_col_offset": 50, "src": "671:42:0", "node_id": 128, "ast_type": "Hex", "type": {"name": "address"}}, {"lineno": 22, "end_lineno": 22, "value": "0x", "col_offset": 8, "end_col_offset": 11, "src": "723:3:0", "node_id": 129, "ast_type": "Bytes", "type": {"length": 0, "name": "Bytes", "typeclass": "bytes"}}], "lineno": 20, "end_lineno": 25, "col_offset": 27, "end_col_offset": 5, "src": "653:132:0", "node_id": 125, "keywords": [{"lineno": 23, "end_lineno": 23, "value": {"lineno": 23, "end_lineno": 23, "value": 32, "col_offset": 20, "end_col_offset": 22, "src": "748:2:0", "node_id": 131, "ast_type": "Int", "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "col_offset": 8, "arg": "max_outsize", "end_col_offset": 22, "src": "736:14:0", "node_id": 130, "ast_type": "keyword"}, {"lineno": 24, "end_lineno": 24, "value": {"lineno": 24, "end_lineno": 24, "value": true, "col_offset": 23, "end_col_offset": 27, "src": "775:4:0", "node_id": 133, "ast_type": "NameConstant", "type": {"name": "bool"}}, "col_offset": 8, "arg": "is_static_call", "end_col_offset": 27, "src": "760:19:0", "node_id": 132, "ast_type": "keyword"}], "ast_type": "Call", "type": {"length": 32, "name": "Bytes", "typeclass": "bytes"}}, "col_offset": 4, "end_col_offset": 5, "src": "630:155:0", "target": {"lineno": 20, "end_lineno": 20, "id": "response2", "col_offset": 4, "end_col_offset": 13, "src": "630:9:0", "node_id": 118, "ast_type": "Name", "type": {"length": 32, "name": "Bytes", "typeclass": "bytes"}, "variable_reads": [{"name": "response2", "decl_node": {"node_id": 117, "source_id": 0}, "access_path": []}]}, "node_id": 117, "ast_type": "AnnAssign"}, {"lineno": 26, "end_lineno": 26, "value": {"func": {"lineno": 26, "end_lineno": 26, "id": "keccak256", "col_offset": 11, "end_col_offset": 20, "src": "797:9:0", "node_id": 136, "ast_type": "Name", "type": {"name": "keccak256", "typeclass": "builtin_function"}}, "args": [{"lineno": 26, "end_lineno": 26, "id": "some_bytes", "col_offset": 21, "end_col_offset": 31, "src": "807:10:0", "node_id": 138, "ast_type": "Name", "type": {"length": 10, "name": "Bytes", "typeclass": "bytes"}, "variable_reads": [{"name": "some_bytes", "decl_node": {"node_id": 31, "source_id": 0}, "access_path": []}]}], "lineno": 26, "end_lineno": 26, "col_offset": 11, "end_col_offset": 32, "src": "797:21:0", "node_id": 135, "keywords": [], "ast_type": "Call", "type": {"m": 32, "name": "bytes32", "typeclass": "bytes_m"}}, "col_offset": 4, "end_col_offset": 32, "src": "790:28:0", "node_id": 134, "ast_type": "Return"}], "node_id": 23, "ast_type": "FunctionDef"}], "source_id": 0, "node_id": 0, "is_interface": false, "ast_type": "Module", "type": {"name": "types.vy", "type_decl_node": {"node_id": 0, "source_id": 0}, "typeclass": "module"}} \ No newline at end of file +{"lineno": 1, "body": [{"lineno": 3, "body": [{"lineno": 4, "simple": 1, "col_offset": 4, "end_lineno": 4, "ast_type": "AnnAssign", "end_col_offset": 16, "annotation": {"lineno": 4, "col_offset": 9, "end_lineno": 4, "ast_type": "Name", "end_col_offset": 16, "id": "uint256", "node_id": 5, "src": "48:7:0"}, "node_id": 2, "src": "43:12:0", "value": null, "target": {"lineno": 4, "col_offset": 4, "end_lineno": 4, "ast_type": "Name", "end_col_offset": 7, "id": "age", "node_id": 3, "src": "43:3:0"}}], "col_offset": 0, "end_lineno": 4, "ast_type": "StructDef", "name": "Person", "end_col_offset": 16, "node_id": 1, "src": "24:31:0"}, {"pos": null, "lineno": 7, "body": [{"lineno": 8, "col_offset": 4, "end_lineno": 10, "ast_type": "Return", "end_col_offset": 6, "node_id": 9, "src": "102:39:0", "value": {"lineno": 8, "col_offset": 11, "end_lineno": 10, "func": {"lineno": 8, "col_offset": 11, "end_lineno": 8, "ast_type": "Name", "end_col_offset": 17, "id": "Person", "node_id": 11, "src": "109:6:0"}, "ast_type": "Call", "end_col_offset": 6, "keywords": [], "node_id": 10, "args": [{"lineno": 8, "col_offset": 18, "end_lineno": 10, "ast_type": "Dict", "end_col_offset": 5, "node_id": 13, "values": [{"lineno": 9, "col_offset": 13, "end_lineno": 9, "ast_type": "Int", "end_col_offset": 15, "node_id": 16, "src": "131:2:0", "value": 30}], "keys": [{"lineno": 9, "col_offset": 8, "end_lineno": 9, "ast_type": "Name", "end_col_offset": 11, "id": "age", "node_id": 14, "src": "126:3:0"}], "src": "116:24:0"}], "keyword": null, "src": "109:32:0"}}], "col_offset": 0, "end_lineno": 10, "name": "create_person", "ast_type": "FunctionDef", "end_col_offset": 6, "returns": {"lineno": 7, "col_offset": 23, "end_lineno": 7, "ast_type": "Name", "end_col_offset": 29, "id": "Person", "node_id": 19, "src": "90:6:0"}, "doc_string": null, "node_id": 7, "args": {"lineno": 7, "col_offset": 0, "default": null, "end_lineno": 7, "ast_type": "arguments", "end_col_offset": 3, "node_id": 8, "defaults": [], "args": [], "src": "67:3:0"}, "src": "67:74:0", "decorator_list": [{"lineno": 6, "col_offset": 1, "end_lineno": 6, "ast_type": "Name", "end_col_offset": 9, "id": "external", "node_id": 17, "src": "58:8:0"}]}], "col_offset": 0, "end_lineno": 10, "ast_type": "Module", "name": "/tmp/vyper_samples/types.vy", "end_col_offset": 6, "node_id": 0, "doc_string": null, "src": "0:141:0"} \ No newline at end of file From a8c913e8ecb5717c7545b2bbeb7ea10b51caa251 Mon Sep 17 00:00:00 2001 From: francois Date: Sat, 26 Jul 2025 10:47:16 +0700 Subject: [PATCH 08/11] fix JSON --- test-data/vyper_ast/calls.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-data/vyper_ast/calls.json b/test-data/vyper_ast/calls.json index c3fac2b5b..6e69a520c 100644 --- a/test-data/vyper_ast/calls.json +++ b/test-data/vyper_ast/calls.json @@ -1 +1 @@ -{"source_sha256sum": "e5f33d825c375a4c97fb022af85ef74ba9009183d4ddec874c0699c6fc496785", "source_id": 0, "body": [{"lineno": 1, "col_offset": 0, "end_lineno": 1, "src": "0:32:0", "ast_type": "ImportFrom", "module": "ethereum.ercs", "level": 0, "node_id": 1, "end_col_offset": 32, "alias": null, "name": "IERC20", "import_info": {"alias": "IERC20", "qualified_module_name": "ethereum.ercs.IERC20", "source_id": -2, "path": "vyper/builtins/interfaces/IERC20.vyi", "resolved_path": "/home/francois/.local/share/uv/tools/vyper/lib/python3.12/site-packages/vyper/builtins/interfaces/IERC20.vyi", "file_sha256sum": "4b175cac05c3e50785083c1020c5cd371a9d5b967f7c7c8e921fabc890497482"}}, {"body": [{"lineno": 5, "end_lineno": 5, "src": "112:38:0", "ast_type": "Return", "value": {"lineno": 5, "end_lineno": 5, "src": "119:31:0", "ast_type": "ExtCall", "value": {"func": {"lineno": 5, "end_lineno": 5, "attr": "transfer", "src": "127:14:0", "ast_type": "Attribute", "value": {"lineno": 5, "id": "token", "end_lineno": 5, "src": "127:5:0", "ast_type": "Name", "node_id": 18, "end_col_offset": 24, "col_offset": 19, "type": {"name": "/home/francois/.local/share/uv/tools/vyper/lib/python3.12/site-packages/vyper/builtins/interfaces/IERC20.vyi", "type_decl_node": {"node_id": 0, "source_id": -2}, "typeclass": "interface"}, "variable_reads": [{"name": "token", "decl_node": {"node_id": 5, "source_id": 0}, "access_path": []}]}, "node_id": 17, "end_col_offset": 33, "col_offset": 19, "type": {"name": "transfer", "type_decl_node": {"node_id": 78, "source_id": -2}, "typeclass": "contract_function"}, "variable_reads": [{"name": "token", "decl_node": {"node_id": 5, "source_id": 0}, "access_path": ["transfer"]}]}, "lineno": 5, "end_lineno": 5, "src": "127:23:0", "ast_type": "Call", "keywords": [], "node_id": 16, "end_col_offset": 42, "col_offset": 19, "args": [{"lineno": 5, "id": "to", "end_lineno": 5, "src": "142:2:0", "ast_type": "Name", "node_id": 21, "end_col_offset": 36, "col_offset": 34, "type": {"name": "address"}, "variable_reads": [{"name": "to", "decl_node": {"node_id": 8, "source_id": 0}, "access_path": []}]}, {"lineno": 5, "id": "wad", "end_lineno": 5, "src": "146:3:0", "ast_type": "Name", "node_id": 23, "end_col_offset": 41, "col_offset": 38, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "wad", "decl_node": {"node_id": 11, "source_id": 0}, "access_path": []}]}], "type": {"name": "bool"}}, "node_id": 15, "end_col_offset": 42, "col_offset": 11, "type": {"name": "bool"}}, "node_id": 14, "end_col_offset": 42, "col_offset": 4}], "decorator_list": [{"lineno": 3, "id": "external", "end_lineno": 3, "src": "35:8:0", "ast_type": "Name", "node_id": 25, "end_col_offset": 9, "col_offset": 1}], "lineno": 4, "doc_string": null, "col_offset": 0, "end_lineno": 5, "src": "44:106:0", "ast_type": "FunctionDef", "name": "transfer", "node_id": 3, "end_col_offset": 42, "pos": null, "args": {"lineno": 4, "end_lineno": 5, "default": null, "src": "44:106:0", "defaults": [], "ast_type": "arguments", "node_id": 4, "end_col_offset": 42, "col_offset": 0, "args": [{"annotation": {"lineno": 4, "id": "IERC20", "end_lineno": 4, "src": "64:6:0", "ast_type": "Name", "node_id": 6, "end_col_offset": 26, "col_offset": 20}, "lineno": 4, "arg": "token", "end_lineno": 4, "src": "57:13:0", "ast_type": "arg", "node_id": 5, "end_col_offset": 26, "col_offset": 13}, {"annotation": {"lineno": 4, "id": "address", "end_lineno": 4, "src": "76:7:0", "ast_type": "Name", "node_id": 9, "end_col_offset": 39, "col_offset": 32}, "lineno": 4, "arg": "to", "end_lineno": 4, "src": "72:11:0", "ast_type": "arg", "node_id": 8, "end_col_offset": 39, "col_offset": 28}, {"annotation": {"lineno": 4, "id": "uint256", "end_lineno": 4, "src": "90:7:0", "ast_type": "Name", "node_id": 12, "end_col_offset": 53, "col_offset": 46}, "lineno": 4, "arg": "wad", "end_lineno": 4, "src": "85:12:0", "ast_type": "arg", "node_id": 11, "end_col_offset": 53, "col_offset": 41}]}, "returns": {"lineno": 4, "id": "bool", "end_lineno": 4, "src": "102:4:0", "ast_type": "Name", "node_id": 27, "end_col_offset": 62, "col_offset": 58}}, {"body": [{"lineno": 9, "end_lineno": 9, "src": "209:39:0", "ast_type": "Return", "value": {"lineno": 9, "end_lineno": 9, "src": "216:32:0", "ast_type": "StaticCall", "value": {"func": {"lineno": 9, "end_lineno": 9, "attr": "balanceOf", "src": "227:15:0", "ast_type": "Attribute", "value": {"lineno": 9, "id": "token", "end_lineno": 9, "src": "227:5:0", "ast_type": "Name", "node_id": 38, "end_col_offset": 27, "col_offset": 22, "type": {"name": "/home/francois/.local/share/uv/tools/vyper/lib/python3.12/site-packages/vyper/builtins/interfaces/IERC20.vyi", "type_decl_node": {"node_id": 0, "source_id": -2}, "typeclass": "interface"}, "variable_reads": [{"name": "token", "decl_node": {"node_id": 31, "source_id": 0}, "access_path": []}]}, "node_id": 37, "end_col_offset": 37, "col_offset": 22, "type": {"name": "balanceOf", "type_decl_node": {"node_id": 53, "source_id": -2}, "typeclass": "contract_function"}, "variable_reads": [{"name": "token", "decl_node": {"node_id": 31, "source_id": 0}, "access_path": ["balanceOf"]}]}, "lineno": 9, "end_lineno": 9, "src": "227:21:0", "ast_type": "Call", "keywords": [], "node_id": 36, "end_col_offset": 43, "col_offset": 22, "args": [{"lineno": 9, "id": "self", "end_lineno": 9, "src": "243:4:0", "ast_type": "Name", "node_id": 41, "end_col_offset": 42, "col_offset": 38, "type": {"name": "address"}}], "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "node_id": 35, "end_col_offset": 43, "col_offset": 11, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "node_id": 34, "end_col_offset": 43, "col_offset": 4}], "decorator_list": [{"lineno": 7, "id": "external", "end_lineno": 7, "src": "153:8:0", "ast_type": "Name", "node_id": 43, "end_col_offset": 9, "col_offset": 1}], "lineno": 8, "doc_string": null, "col_offset": 0, "end_lineno": 9, "src": "162:86:0", "ast_type": "FunctionDef", "name": "get_balance", "node_id": 29, "end_col_offset": 43, "pos": null, "args": {"lineno": 8, "end_lineno": 9, "default": null, "src": "162:86:0", "defaults": [], "ast_type": "arguments", "node_id": 30, "end_col_offset": 43, "col_offset": 0, "args": [{"annotation": {"lineno": 8, "id": "IERC20", "end_lineno": 8, "src": "185:6:0", "ast_type": "Name", "node_id": 32, "end_col_offset": 29, "col_offset": 23}, "lineno": 8, "arg": "token", "end_lineno": 8, "src": "178:13:0", "ast_type": "arg", "node_id": 31, "end_col_offset": 29, "col_offset": 16}]}, "returns": {"lineno": 8, "id": "uint256", "end_lineno": 8, "src": "196:7:0", "ast_type": "Name", "node_id": 45, "end_col_offset": 41, "col_offset": 34}}], "lineno": 1, "doc_string": null, "col_offset": 0, "end_lineno": 9, "path": "calls.vy", "src": "0:249:0", "ast_type": "Module", "settings": {}, "resolved_path": "/tmp/vyper_samples/calls.vy", "node_id": 0, "end_col_offset": 44, "is_interface": false, "name": null, "type": {"name": "calls.vy", "type_decl_node": {"node_id": 0, "source_id": 0}, "typeclass": "module"}} \ No newline at end of file +{"source_sha256sum": "e5f33d825c375a4c97fb022af85ef74ba9009183d4ddec874c0699c6fc496785", "source_id": 0, "body": [{"lineno": 1, "col_offset": 0, "end_lineno": 1, "src": "0:32:0", "ast_type": "ImportFrom", "module": "ethereum.ercs", "level": 0, "node_id": 1, "end_col_offset": 32, "alias": null, "name": "IERC20", "import_info": {"alias": "IERC20", "qualified_module_name": "ethereum.ercs.IERC20", "source_id": -2, "path": "vyper/builtins/interfaces/IERC20.vyi", "resolved_path": "/home/user/.local/share/uv/tools/vyper/lib/python3.12/site-packages/vyper/builtins/interfaces/IERC20.vyi", "file_sha256sum": "4b175cac05c3e50785083c1020c5cd371a9d5b967f7c7c8e921fabc890497482"}}, {"body": [{"lineno": 5, "end_lineno": 5, "src": "112:38:0", "ast_type": "Return", "value": {"lineno": 5, "end_lineno": 5, "src": "119:31:0", "ast_type": "ExtCall", "value": {"func": {"lineno": 5, "end_lineno": 5, "attr": "transfer", "src": "127:14:0", "ast_type": "Attribute", "value": {"lineno": 5, "id": "token", "end_lineno": 5, "src": "127:5:0", "ast_type": "Name", "node_id": 18, "end_col_offset": 24, "col_offset": 19, "type": {"name": "/home/user/.local/share/uv/tools/vyper/lib/python3.12/site-packages/vyper/builtins/interfaces/IERC20.vyi", "type_decl_node": {"node_id": 0, "source_id": -2}, "typeclass": "interface"}, "variable_reads": [{"name": "token", "decl_node": {"node_id": 5, "source_id": 0}, "access_path": []}]}, "node_id": 17, "end_col_offset": 33, "col_offset": 19, "type": {"name": "transfer", "type_decl_node": {"node_id": 78, "source_id": -2}, "typeclass": "contract_function"}, "variable_reads": [{"name": "token", "decl_node": {"node_id": 5, "source_id": 0}, "access_path": ["transfer"]}]}, "lineno": 5, "end_lineno": 5, "src": "127:23:0", "ast_type": "Call", "keywords": [], "node_id": 16, "end_col_offset": 42, "col_offset": 19, "args": [{"lineno": 5, "id": "to", "end_lineno": 5, "src": "142:2:0", "ast_type": "Name", "node_id": 21, "end_col_offset": 36, "col_offset": 34, "type": {"name": "address"}, "variable_reads": [{"name": "to", "decl_node": {"node_id": 8, "source_id": 0}, "access_path": []}]}, {"lineno": 5, "id": "wad", "end_lineno": 5, "src": "146:3:0", "ast_type": "Name", "node_id": 23, "end_col_offset": 41, "col_offset": 38, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}, "variable_reads": [{"name": "wad", "decl_node": {"node_id": 11, "source_id": 0}, "access_path": []}]}], "type": {"name": "bool"}}, "node_id": 15, "end_col_offset": 42, "col_offset": 11, "type": {"name": "bool"}}, "node_id": 14, "end_col_offset": 42, "col_offset": 4}], "decorator_list": [{"lineno": 3, "id": "external", "end_lineno": 3, "src": "35:8:0", "ast_type": "Name", "node_id": 25, "end_col_offset": 9, "col_offset": 1}], "lineno": 4, "doc_string": null, "col_offset": 0, "end_lineno": 5, "src": "44:106:0", "ast_type": "FunctionDef", "name": "transfer", "node_id": 3, "end_col_offset": 42, "pos": null, "args": {"lineno": 4, "end_lineno": 5, "default": null, "src": "44:106:0", "defaults": [], "ast_type": "arguments", "node_id": 4, "end_col_offset": 42, "col_offset": 0, "args": [{"annotation": {"lineno": 4, "id": "IERC20", "end_lineno": 4, "src": "64:6:0", "ast_type": "Name", "node_id": 6, "end_col_offset": 26, "col_offset": 20}, "lineno": 4, "arg": "token", "end_lineno": 4, "src": "57:13:0", "ast_type": "arg", "node_id": 5, "end_col_offset": 26, "col_offset": 13}, {"annotation": {"lineno": 4, "id": "address", "end_lineno": 4, "src": "76:7:0", "ast_type": "Name", "node_id": 9, "end_col_offset": 39, "col_offset": 32}, "lineno": 4, "arg": "to", "end_lineno": 4, "src": "72:11:0", "ast_type": "arg", "node_id": 8, "end_col_offset": 39, "col_offset": 28}, {"annotation": {"lineno": 4, "id": "uint256", "end_lineno": 4, "src": "90:7:0", "ast_type": "Name", "node_id": 12, "end_col_offset": 53, "col_offset": 46}, "lineno": 4, "arg": "wad", "end_lineno": 4, "src": "85:12:0", "ast_type": "arg", "node_id": 11, "end_col_offset": 53, "col_offset": 41}]}, "returns": {"lineno": 4, "id": "bool", "end_lineno": 4, "src": "102:4:0", "ast_type": "Name", "node_id": 27, "end_col_offset": 62, "col_offset": 58}}, {"body": [{"lineno": 9, "end_lineno": 9, "src": "209:39:0", "ast_type": "Return", "value": {"lineno": 9, "end_lineno": 9, "src": "216:32:0", "ast_type": "StaticCall", "value": {"func": {"lineno": 9, "end_lineno": 9, "attr": "balanceOf", "src": "227:15:0", "ast_type": "Attribute", "value": {"lineno": 9, "id": "token", "end_lineno": 9, "src": "227:5:0", "ast_type": "Name", "node_id": 38, "end_col_offset": 27, "col_offset": 22, "type": {"name": "/home/user/.local/share/uv/tools/vyper/lib/python3.12/site-packages/vyper/builtins/interfaces/IERC20.vyi", "type_decl_node": {"node_id": 0, "source_id": -2}, "typeclass": "interface"}, "variable_reads": [{"name": "token", "decl_node": {"node_id": 31, "source_id": 0}, "access_path": []}]}, "node_id": 37, "end_col_offset": 37, "col_offset": 22, "type": {"name": "balanceOf", "type_decl_node": {"node_id": 53, "source_id": -2}, "typeclass": "contract_function"}, "variable_reads": [{"name": "token", "decl_node": {"node_id": 31, "source_id": 0}, "access_path": ["balanceOf"]}]}, "lineno": 9, "end_lineno": 9, "src": "227:21:0", "ast_type": "Call", "keywords": [], "node_id": 36, "end_col_offset": 43, "col_offset": 22, "args": [{"lineno": 9, "id": "self", "end_lineno": 9, "src": "243:4:0", "ast_type": "Name", "node_id": 41, "end_col_offset": 42, "col_offset": 38, "type": {"name": "address"}}], "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "node_id": 35, "end_col_offset": 43, "col_offset": 11, "type": {"is_signed": false, "bits": 256, "name": "uint256", "typeclass": "integer"}}, "node_id": 34, "end_col_offset": 43, "col_offset": 4}], "decorator_list": [{"lineno": 7, "id": "external", "end_lineno": 7, "src": "153:8:0", "ast_type": "Name", "node_id": 43, "end_col_offset": 9, "col_offset": 1}], "lineno": 8, "doc_string": null, "col_offset": 0, "end_lineno": 9, "src": "162:86:0", "ast_type": "FunctionDef", "name": "get_balance", "node_id": 29, "end_col_offset": 43, "pos": null, "args": {"lineno": 8, "end_lineno": 9, "default": null, "src": "162:86:0", "defaults": [], "ast_type": "arguments", "node_id": 30, "end_col_offset": 43, "col_offset": 0, "args": [{"annotation": {"lineno": 8, "id": "IERC20", "end_lineno": 8, "src": "185:6:0", "ast_type": "Name", "node_id": 32, "end_col_offset": 29, "col_offset": 23}, "lineno": 8, "arg": "token", "end_lineno": 8, "src": "178:13:0", "ast_type": "arg", "node_id": 31, "end_col_offset": 29, "col_offset": 16}]}, "returns": {"lineno": 8, "id": "uint256", "end_lineno": 8, "src": "196:7:0", "ast_type": "Name", "node_id": 45, "end_col_offset": 41, "col_offset": 34}}], "lineno": 1, "doc_string": null, "col_offset": 0, "end_lineno": 9, "path": "calls.vy", "src": "0:249:0", "ast_type": "Module", "settings": {}, "resolved_path": "/tmp/vyper_samples/calls.vy", "node_id": 0, "end_col_offset": 44, "is_interface": false, "name": null, "type": {"name": "calls.vy", "type_decl_node": {"node_id": 0, "source_id": 0}, "typeclass": "module"}} \ No newline at end of file From cd971e8ccb6432198efef8843d39b509d2fc57d6 Mon Sep 17 00:00:00 2001 From: francois Date: Sat, 26 Jul 2025 10:48:28 +0700 Subject: [PATCH 09/11] remove visitor file --- crates/artifacts/vyper/src/ast/visitor.rs | 1 - 1 file changed, 1 deletion(-) delete mode 100644 crates/artifacts/vyper/src/ast/visitor.rs diff --git a/crates/artifacts/vyper/src/ast/visitor.rs b/crates/artifacts/vyper/src/ast/visitor.rs deleted file mode 100644 index 8b1378917..000000000 --- a/crates/artifacts/vyper/src/ast/visitor.rs +++ /dev/null @@ -1 +0,0 @@ - From 7d246ff00bfe3ed3c5243b9ba8747e3d8204543f Mon Sep 17 00:00:00 2001 From: francois Date: Sat, 26 Jul 2025 11:20:54 +0700 Subject: [PATCH 10/11] format --- crates/artifacts/vyper/src/ast/macros.rs | 2 +- crates/artifacts/vyper/src/ast/mod.rs | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/crates/artifacts/vyper/src/ast/macros.rs b/crates/artifacts/vyper/src/ast/macros.rs index adbeb5f31..33f09f15f 100644 --- a/crates/artifacts/vyper/src/ast/macros.rs +++ b/crates/artifacts/vyper/src/ast/macros.rs @@ -61,6 +61,6 @@ macro_rules! node_group { }; } -pub(crate) use vyper_node; pub(crate) use basic_vyper_nodes; pub(crate) use node_group; +pub(crate) use vyper_node; diff --git a/crates/artifacts/vyper/src/ast/mod.rs b/crates/artifacts/vyper/src/ast/mod.rs index d25cda910..596514bb8 100644 --- a/crates/artifacts/vyper/src/ast/mod.rs +++ b/crates/artifacts/vyper/src/ast/mod.rs @@ -1,7 +1,6 @@ use serde::{Deserialize, Serialize}; mod macros; -pub mod visitor; use crate::ast::macros::{basic_vyper_nodes, node_group}; use macros::vyper_node; @@ -115,7 +114,7 @@ vyper_node!( struct Import { alias: Option, name: String, - import_info: ImportInfo + import_info: ImportInfo, } ); @@ -548,9 +547,7 @@ node_group!( Invert, ); -basic_vyper_nodes!( - USub, Not, Invert -); +basic_vyper_nodes!(USub, Not, Invert); node_group!( BinaryOperator; From 20cf2d9537af9a1c8034c299825737a104b587cf Mon Sep 17 00:00:00 2001 From: francois Date: Sat, 26 Jul 2025 13:10:17 +0700 Subject: [PATCH 11/11] add deprecated Index node --- crates/artifacts/vyper/src/ast/mod.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/artifacts/vyper/src/ast/mod.rs b/crates/artifacts/vyper/src/ast/mod.rs index 596514bb8..140c96233 100644 --- a/crates/artifacts/vyper/src/ast/mod.rs +++ b/crates/artifacts/vyper/src/ast/mod.rs @@ -114,7 +114,7 @@ vyper_node!( struct Import { alias: Option, name: String, - import_info: ImportInfo, + import_info: Option, } ); @@ -122,7 +122,7 @@ vyper_node!( struct ImportFrom { alias: Option, name: String, - import_info: ImportInfo, + import_info: Option, module: Option, level: u32, } @@ -286,6 +286,7 @@ node_group!( HexBytes, NameConstant, Ellipsis, + Index, // Collections List, @@ -392,6 +393,12 @@ vyper_node!( } ); +vyper_node!( + struct Index { + value: Box, + } +); + vyper_node!( struct List { elements: Vec,