Last active
October 21, 2021 01:19
-
-
Save charles-cooper/b35dc96c4f952b586f9ec654ba252c6b to your computer and use it in GitHub Desktop.
Vyper Issue #2276
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"contract_name": "owned.vy", "ast": {"name": "owned.vy", "end_lineno": 7, "body": [{"end_lineno": 1, "annotation": {"end_lineno": 1, "func": {"end_lineno": 1, "src": "7:6:0", "end_col_offset": 13, "col_offset": 7, "ast_type": "Name", "node_id": 5, "id": "public", "lineno": 1}, "src": "7:15:0", "end_col_offset": 22, "col_offset": 7, "ast_type": "Call", "keywords": [], "node_id": 4, "args": [{"end_lineno": 1, "src": "14:7:0", "end_col_offset": 21, "col_offset": 14, "ast_type": "Name", "node_id": 7, "id": "address", "lineno": 1}], "lineno": 1, "keyword": null}, "value": null, "src": "0:22:0", "end_col_offset": 22, "col_offset": 0, "ast_type": "AnnAssign", "node_id": 1, "target": {"end_lineno": 1, "src": "0:5:0", "end_col_offset": 5, "col_offset": 0, "ast_type": "Name", "node_id": 2, "id": "owner", "lineno": 1}, "lineno": 1, "simple": 1}, {"name": "withdraw", "end_lineno": 7, "decorator_list": [{"end_lineno": 3, "src": "25:8:0", "end_col_offset": 9, "col_offset": 1, "ast_type": "Name", "node_id": 42, "id": "external", "lineno": 3}], "body": [{"end_lineno": 5, "msg": null, "src": "66:31:0", "end_col_offset": 35, "test": {"end_lineno": 5, "lineno": 5, "src": "73:24:0", "end_col_offset": 35, "col_offset": 11, "op": {"end_lineno": 5, "src": "73:24:0", "end_col_offset": 35, "col_offset": 11, "ast_type": "Eq", "node_id": 20, "lineno": 5}, "left": {"end_lineno": 5, "value": {"end_lineno": 5, "src": "73:3:0", "end_col_offset": 14, "col_offset": 11, "ast_type": "Name", "node_id": 17, "id": "msg", "lineno": 5}, "src": "73:10:0", "end_col_offset": 21, "attr": "sender", "col_offset": 11, "ast_type": "Attribute", "node_id": 16, "lineno": 5}, "ast_type": "Compare", "node_id": 15, "right": {"end_lineno": 5, "value": {"end_lineno": 5, "src": "87:4:0", "end_col_offset": 29, "col_offset": 25, "ast_type": "Name", "node_id": 22, "id": "self", "lineno": 5}, "src": "87:10:0", "end_col_offset": 35, "attr": "owner", "col_offset": 25, "ast_type": "Attribute", "node_id": 21, "lineno": 5}}, "col_offset": 4, "ast_type": "Assert", "node_id": 14, "lineno": 5}, {"end_lineno": 7, "body": [{"end_lineno": 7, "value": {"end_lineno": 7, "func": {"end_lineno": 7, "src": "129:4:0", "end_col_offset": 12, "col_offset": 8, "ast_type": "Name", "node_id": 34, "id": "send", "lineno": 7}, "src": "129:21:0", "end_col_offset": 29, "col_offset": 8, "ast_type": "Call", "keywords": [], "node_id": 33, "args": [{"end_lineno": 7, "value": {"end_lineno": 7, "src": "134:3:0", "end_col_offset": 16, "col_offset": 13, "ast_type": "Name", "node_id": 37, "id": "msg", "lineno": 7}, "src": "134:10:0", "end_col_offset": 23, "attr": "sender", "col_offset": 13, "ast_type": "Attribute", "node_id": 36, "lineno": 7}, {"end_lineno": 7, "src": "146:3:0", "end_col_offset": 28, "col_offset": 25, "ast_type": "Name", "node_id": 40, "id": "val", "lineno": 7}], "lineno": 7, "keyword": null}, "src": "129:21:0", "end_col_offset": 29, "col_offset": 8, "ast_type": "Expr", "node_id": 32, "lineno": 7}], "src": "102:48:0", "end_col_offset": 29, "col_offset": 4, "iter": {"end_lineno": 6, "func": {"end_lineno": 6, "src": "111:5:0", "end_col_offset": 18, "col_offset": 13, "ast_type": "Name", "node_id": 29, "id": "range", "lineno": 6}, "src": "111:8:0", "end_col_offset": 21, "col_offset": 13, "ast_type": "Call", "keywords": [], "node_id": 28, "args": [{"end_lineno": 6, "value": 8, "src": "117:1:0", "end_col_offset": 20, "col_offset": 19, "ast_type": "Int", "node_id": 31, "lineno": 6}], "lineno": 6, "keyword": null}, "ast_type": "For", "node_id": 25, "target": {"end_lineno": 6, "src": "106:1:0", "end_col_offset": 9, "col_offset": 8, "ast_type": "Name", "node_id": 26, "id": "i", "lineno": 6}, "lineno": 6}], "src": "34:116:0", "end_col_offset": 29, "col_offset": 0, "doc_string": null, "ast_type": "FunctionDef", "node_id": 9, "pos": null, "args": {"end_lineno": 4, "src": "47:12:0", "end_col_offset": 25, "default": null, "defaults": [], "col_offset": 13, "ast_type": "arguments", "node_id": 10, "args": [{"end_lineno": 4, "annotation": {"end_lineno": 4, "src": "52:7:0", "end_col_offset": 25, "col_offset": 18, "ast_type": "Name", "node_id": 12, "id": "uint256", "lineno": 4}, "src": "47:12:0", "end_col_offset": 25, "col_offset": 13, "arg": "val", "ast_type": "arg", "node_id": 11, "lineno": 4}], "lineno": 4}, "lineno": 4, "returns": null}, {"name": "owner", "end_lineno": 1, "decorator_list": [{"end_lineno": 1, "src": "7:15:0", "end_col_offset": 22, "col_offset": 7, "ast_type": null, "node_id": null, "id": "external", "lineno": 1}, {"end_lineno": 1, "src": "7:15:0", "end_col_offset": 22, "col_offset": 7, "ast_type": null, "node_id": null, "id": "view", "lineno": 1}], "body": [{"end_lineno": 1, "value": {"end_lineno": null, "value": {"end_lineno": null, "src": null, "end_col_offset": null, "col_offset": null, "ast_type": null, "node_id": null, "id": "self", "lineno": null}, "src": null, "end_col_offset": null, "attr": "owner", "col_offset": null, "ast_type": null, "node_id": null, "lineno": null}, "src": "7:15:0", "end_col_offset": 22, "col_offset": 7, "ast_type": null, "node_id": null, "lineno": 1}], "src": "7:15:0", "end_col_offset": 22, "col_offset": 7, "doc_string": null, "ast_type": "FunctionDef", "node_id": 4, "pos": null, "args": {"end_lineno": 1, "src": "7:15:0", "end_col_offset": 22, "default": null, "defaults": [], "col_offset": 7, "ast_type": null, "node_id": null, "args": [], "lineno": 1}, "lineno": 1, "returns": {"end_lineno": 1, "src": "14:7:0", "end_col_offset": 21, "col_offset": 14, "ast_type": "Name", "node_id": 7, "id": "address", "lineno": 1}}], "src": "0:150:0", "end_col_offset": 29, "col_offset": 0, "doc_string": null, "ast_type": "Module", "node_id": 0, "lineno": 1}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"contract_name": "owned.vy", "ast": {"node_id": 0, "end_lineno": 7, "col_offset": 0, "lineno": 1, "src": "0:150:0", "end_col_offset": 29, "doc_string": null, "ast_type": "Module", "name": "owned.vy", "_metadata": {"type": "InterfacePrimitive"}, "body": [{"node_id": 1, "value": null, "simple": 1, "end_lineno": 1, "col_offset": 0, "lineno": 1, "src": "0:22:0", "target": {"node_id": 2, "end_lineno": 1, "col_offset": 0, "lineno": 1, "src": "0:5:0", "end_col_offset": 5, "ast_type": "Name", "_metadata": {"type": "AddressDefinition"}, "id": "owner"}, "end_col_offset": 22, "ast_type": "AnnAssign", "annotation": {"keywords": [], "node_id": 4, "end_lineno": 1, "col_offset": 7, "lineno": 1, "src": "7:15:0", "keyword": null, "end_col_offset": 22, "ast_type": "Call", "func": {"node_id": 5, "end_lineno": 1, "col_offset": 7, "lineno": 1, "src": "7:6:0", "end_col_offset": 13, "ast_type": "Name", "_metadata": {}, "id": "public"}, "_metadata": {}, "args": [{"node_id": 7, "end_lineno": 1, "col_offset": 14, "lineno": 1, "src": "14:7:0", "end_col_offset": 21, "ast_type": "Name", "_metadata": {}, "id": "address"}]}, "_metadata": {"func_type": "ContractFunction", "type": "AddressDefinition"}}, {"node_id": 9, "end_lineno": 7, "col_offset": 0, "lineno": 4, "src": "34:116:0", "end_col_offset": 29, "returns": null, "pos": null, "decorator_list": [{"node_id": 42, "end_lineno": 3, "col_offset": 1, "lineno": 3, "src": "25:8:0", "end_col_offset": 9, "ast_type": "Name", "_metadata": {}, "id": "external"}], "name": "withdraw", "body": [{"node_id": 14, "end_lineno": 5, "col_offset": 4, "lineno": 5, "test": {"right": {"node_id": 21, "value": {"node_id": 22, "end_lineno": 5, "col_offset": 25, "lineno": 5, "src": "87:4:0", "end_col_offset": 29, "ast_type": "Name", "_metadata": {"type": "AddressDefinition"}, "id": "self"}, "end_lineno": 5, "col_offset": 25, "lineno": 5, "src": "87:10:0", "end_col_offset": 35, "ast_type": "Attribute", "attr": "owner", "_metadata": {"type": "AddressDefinition"}}, "left": {"node_id": 16, "value": {"node_id": 17, "end_lineno": 5, "col_offset": 11, "lineno": 5, "src": "73:3:0", "end_col_offset": 14, "ast_type": "Name", "_metadata": {"type": "StructDefinition"}, "id": "msg"}, "end_lineno": 5, "col_offset": 11, "lineno": 5, "src": "73:10:0", "end_col_offset": 21, "ast_type": "Attribute", "attr": "sender", "_metadata": {"type": "AddressDefinition"}}, "node_id": 15, "end_lineno": 5, "col_offset": 11, "lineno": 5, "src": "73:24:0", "end_col_offset": 35, "op": {"node_id": 20, "end_lineno": 5, "col_offset": 11, "lineno": 5, "src": "73:24:0", "end_col_offset": 35, "ast_type": "Eq", "_metadata": {}}, "ast_type": "Compare", "_metadata": {}}, "src": "66:31:0", "end_col_offset": 35, "ast_type": "Assert", "_metadata": {}, "msg": null}, {"node_id": 25, "end_lineno": 7, "col_offset": 4, "lineno": 6, "src": "102:48:0", "target": {"node_id": 26, "end_lineno": 6, "col_offset": 8, "lineno": 6, "src": "106:1:0", "end_col_offset": 9, "ast_type": "Name", "_metadata": {"type": "Uint256Definition"}, "id": "i"}, "iter": {"keywords": [], "node_id": 28, "end_lineno": 6, "col_offset": 13, "lineno": 6, "src": "111:8:0", "keyword": null, "end_col_offset": 21, "ast_type": "Call", "func": {"node_id": 29, "end_lineno": 6, "col_offset": 13, "lineno": 6, "src": "111:5:0", "end_col_offset": 18, "ast_type": "Name", "_metadata": {}, "id": "range"}, "_metadata": {}, "args": [{"node_id": 31, "value": 8, "end_lineno": 6, "col_offset": 19, "lineno": 6, "src": "117:1:0", "end_col_offset": 20, "ast_type": "Int", "_metadata": {}}]}, "end_col_offset": 29, "ast_type": "For", "body": [{"node_id": 32, "value": {"keywords": [], "node_id": 33, "end_lineno": 7, "col_offset": 8, "lineno": 7, "src": "129:21:0", "keyword": null, "end_col_offset": 29, "ast_type": "Call", "func": {"node_id": 34, "end_lineno": 7, "col_offset": 8, "lineno": 7, "src": "129:4:0", "end_col_offset": 12, "ast_type": "Name", "_metadata": {"type": "Send"}, "id": "send"}, "_metadata": {"type": null}, "args": [{"node_id": 36, "value": {"node_id": 37, "end_lineno": 7, "col_offset": 13, "lineno": 7, "src": "134:3:0", "end_col_offset": 16, "ast_type": "Name", "_metadata": {"type": "StructDefinition"}, "id": "msg"}, "end_lineno": 7, "col_offset": 13, "lineno": 7, "src": "134:10:0", "end_col_offset": 23, "ast_type": "Attribute", "attr": "sender", "_metadata": {"type": "AddressDefinition"}}, {"node_id": 40, "end_lineno": 7, "col_offset": 25, "lineno": 7, "src": "146:3:0", "end_col_offset": 28, "ast_type": "Name", "_metadata": {"type": "Uint256Definition"}, "id": "val"}]}, "end_lineno": 7, "col_offset": 8, "lineno": 7, "src": "129:21:0", "end_col_offset": 29, "ast_type": "Expr", "_metadata": {}}], "_metadata": {}}], "doc_string": null, "ast_type": "FunctionDef", "_metadata": {"type": "ContractFunction"}, "args": {"node_id": 10, "end_lineno": 4, "col_offset": 13, "lineno": 4, "src": "47:12:0", "end_col_offset": 25, "default": null, "ast_type": "arguments", "defaults": [], "_metadata": {}, "args": [{"node_id": 11, "end_lineno": 4, "col_offset": 13, "lineno": 4, "src": "47:12:0", "end_col_offset": 25, "ast_type": "arg", "annotation": {"node_id": 12, "end_lineno": 4, "col_offset": 18, "lineno": 4, "src": "52:7:0", "end_col_offset": 25, "ast_type": "Name", "_metadata": {}, "id": "uint256"}, "_metadata": {}, "arg": "val"}]}}, {"node_id": 4, "end_lineno": 1, "col_offset": 7, "lineno": 1, "src": "7:15:0", "end_col_offset": 22, "returns": {"node_id": 7, "end_lineno": 1, "col_offset": 14, "lineno": 1, "src": "14:7:0", "end_col_offset": 21, "ast_type": "Name", "_metadata": {}, "id": "address"}, "pos": null, "decorator_list": [{"node_id": null, "end_lineno": 1, "col_offset": 7, "lineno": 1, "src": "7:15:0", "end_col_offset": 22, "ast_type": null, "_metadata": {}, "id": "external"}, {"node_id": null, "end_lineno": 1, "col_offset": 7, "lineno": 1, "src": "7:15:0", "end_col_offset": 22, "ast_type": null, "_metadata": {}, "id": "view"}], "name": "owner", "body": [{"node_id": null, "value": {"node_id": null, "value": {"node_id": null, "end_lineno": null, "col_offset": null, "lineno": null, "src": null, "end_col_offset": null, "ast_type": null, "_metadata": {}, "id": "self"}, "end_lineno": null, "col_offset": null, "lineno": null, "src": null, "end_col_offset": null, "ast_type": null, "attr": "owner", "_metadata": {"type": "AddressDefinition"}}, "end_lineno": 1, "col_offset": 7, "lineno": 1, "src": "7:15:0", "end_col_offset": 22, "ast_type": null, "_metadata": {}}], "doc_string": null, "ast_type": "FunctionDef", "_metadata": {"type": "ContractFunction"}, "args": {"node_id": null, "end_lineno": 1, "col_offset": 7, "lineno": 1, "src": "7:15:0", "end_col_offset": 22, "default": null, "ast_type": null, "defaults": [], "_metadata": {}, "args": []}}]}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"contract_name": "owned.vy", "ast": {"name": "owned.vy", "end_col_offset": 29, "end_lineno": 7, "doc_string": null, "col_offset": 0, "lineno": 1, "src": "0:150:0", "node_id": 0, "ast_type": "Module", "body": [{"end_col_offset": 22, "end_lineno": 1, "value": null, "lineno": 1, "src": "0:22:0", "node_id": 1, "ast_type": "AnnAssign", "simple": 1, "annotation": {"args": [{"end_col_offset": 21, "end_lineno": 1, "lineno": 1, "src": "14:7:0", "id": "address", "node_id": 7, "ast_type": "Name", "col_offset": 14}], "keyword": null, "end_col_offset": 22, "end_lineno": 1, "keywords": [], "func": {"end_col_offset": 13, "end_lineno": 1, "lineno": 1, "src": "7:6:0", "id": "public", "node_id": 5, "ast_type": "Name", "col_offset": 7}, "lineno": 1, "src": "7:15:0", "node_id": 4, "ast_type": "Call", "col_offset": 7}, "col_offset": 0, "target": {"end_col_offset": 5, "end_lineno": 1, "lineno": 1, "src": "0:5:0", "id": "owner", "node_id": 2, "ast_type": "Name", "col_offset": 0}}, {"decorator_list": [{"end_col_offset": 9, "end_lineno": 3, "lineno": 3, "src": "25:8:0", "id": "external", "node_id": 42, "ast_type": "Name", "col_offset": 1}], "args": {"args": [{"end_col_offset": 25, "end_lineno": 4, "arg": "val", "lineno": 4, "src": "47:12:0", "node_id": 11, "ast_type": "arg", "annotation": {"end_col_offset": 25, "end_lineno": 4, "lineno": 4, "src": "52:7:0", "id": "uint256", "node_id": 12, "ast_type": "Name", "col_offset": 18}, "col_offset": 13}], "end_col_offset": 25, "end_lineno": 4, "lineno": 4, "src": "47:12:0", "node_id": 10, "ast_type": "arguments", "col_offset": 13, "defaults": [], "default": null}, "name": "withdraw", "end_col_offset": 29, "end_lineno": 7, "doc_string": null, "col_offset": 0, "lineno": 4, "src": "34:116:0", "node_id": 9, "ast_type": "FunctionDef", "returns": null, "body": [{"end_col_offset": 35, "end_lineno": 5, "msg": null, "lineno": 5, "src": "66:31:0", "test": {"left": {"end_col_offset": 21, "end_lineno": 5, "value": {"end_col_offset": 14, "end_lineno": 5, "lineno": 5, "src": "73:3:0", "id": "msg", "node_id": 17, "ast_type": "Name", "col_offset": 11}, "lineno": 5, "src": "73:10:0", "attr": "sender", "node_id": 16, "ast_type": "Attribute", "col_offset": 11}, "end_col_offset": 35, "end_lineno": 5, "col_offset": 11, "lineno": 5, "src": "73:24:0", "node_id": 15, "ast_type": "Compare", "right": {"end_col_offset": 35, "end_lineno": 5, "value": {"end_col_offset": 29, "end_lineno": 5, "lineno": 5, "src": "87:4:0", "id": "self", "node_id": 22, "ast_type": "Name", "col_offset": 25}, "lineno": 5, "src": "87:10:0", "attr": "owner", "node_id": 21, "ast_type": "Attribute", "col_offset": 25}, "op": {"end_lineno": 5, "end_col_offset": 35, "lineno": 5, "src": "73:24:0", "node_id": 20, "ast_type": "Eq", "col_offset": 11}}, "node_id": 14, "ast_type": "Assert", "col_offset": 4}, {"end_col_offset": 29, "end_lineno": 7, "col_offset": 4, "lineno": 6, "src": "102:48:0", "node_id": 25, "iter": {"args": [{"end_col_offset": 20, "end_lineno": 6, "value": 8, "lineno": 6, "src": "117:1:0", "node_id": 31, "ast_type": "Int", "col_offset": 19}], "keyword": null, "end_col_offset": 21, "end_lineno": 6, "keywords": [], "func": {"end_col_offset": 18, "end_lineno": 6, "lineno": 6, "src": "111:5:0", "id": "range", "node_id": 29, "ast_type": "Name", "col_offset": 13}, "lineno": 6, "src": "111:8:0", "node_id": 28, "ast_type": "Call", "col_offset": 13}, "ast_type": "For", "body": [{"end_col_offset": 29, "end_lineno": 7, "value": {"args": [{"end_col_offset": 23, "end_lineno": 7, "value": {"end_col_offset": 16, "end_lineno": 7, "lineno": 7, "src": "134:3:0", "id": "msg", "node_id": 37, "ast_type": "Name", "col_offset": 13}, "lineno": 7, "src": "134:10:0", "attr": "sender", "node_id": 36, "ast_type": "Attribute", "col_offset": 13}, {"end_col_offset": 28, "end_lineno": 7, "lineno": 7, "src": "146:3:0", "id": "val", "node_id": 40, "ast_type": "Name", "col_offset": 25}], "keyword": null, "end_col_offset": 29, "end_lineno": 7, "keywords": [], "func": {"end_col_offset": 12, "end_lineno": 7, "lineno": 7, "src": "129:4:0", "id": "send", "node_id": 34, "ast_type": "Name", "col_offset": 8}, "lineno": 7, "src": "129:21:0", "node_id": 33, "ast_type": "Call", "col_offset": 8}, "lineno": 7, "src": "129:21:0", "node_id": 32, "ast_type": "Expr", "col_offset": 8}], "target": {"end_col_offset": 9, "end_lineno": 6, "lineno": 6, "src": "106:1:0", "id": "i", "node_id": 26, "ast_type": "Name", "col_offset": 8}}], "pos": null}]}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
owner: public(address) | |
@external | |
def withdraw(val: uint256): | |
assert msg.sender == self.owner | |
for i in range(8): | |
send(msg.sender, val) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment