Merge pull request #9967 from ethereum/develop

Merge develop into breaking.
This commit is contained in:
chriseth
2020-10-06 17:45:53 +02:00
committed by GitHub
161 changed files with 6537 additions and 259 deletions
+3
View File
@@ -439,6 +439,9 @@ SOLTMPDIR=$(mktemp -d)
)
rm -rf "$SOLTMPDIR"
printTask "Testing AST export with stop-after=parsing..."
"$REPO_ROOT/test/stopAfterParseTests.sh"
printTask "Testing soljson via the fuzzer..."
SOLTMPDIR=$(mktemp -d)
(
@@ -1,4 +1,4 @@
{"errors":[{"component":"general","errorCode":"2904","formattedMessage":":2:24: DeclarationError: Declaration \"A\" not found in \"\" (referenced as \".\").
pragma solidity >=0.0; import {A} from \".\";
^------------------^
","message":"Declaration \"A\" not found in \"\" (referenced as \".\").","severity":"error","type":"DeclarationError"}],"sources":{}}
","message":"Declaration \"A\" not found in \"\" (referenced as \".\").","severity":"error","type":"DeclarationError"}],"sources":{"":{"id":0}}}
+16
View File
@@ -0,0 +1,16 @@
from rule import Rule
from opcodes import *
from util import *
"""
Checking conversion of exp(-1, X) to sub(isZero(and(X, 1)), and(X, 1))
"""
rule = Rule()
n_bits = 256
X = BitVec('X', n_bits)
exp_neg_one = If(MOD(X, 2) == 0, BitVecVal(1, n_bits), BVUnsignedMax(n_bits, n_bits))
rule.check(SUB(ISZERO(AND(X, 1)), AND(X, 1)), exp_neg_one)
@@ -0,0 +1,54 @@
{
"absolutePath": "a",
"id": 6,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": true,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 5,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 3,
"nodeType": "Block",
"src": "37:4:1",
"statements": []
},
"id": 4,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "34:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "37:0:1"
},
"src": "23:18:1",
"stateMutability": "nonpayable",
"virtual": false
}
],
"src": "0:43:1"
}
],
"src": "0:44:1"
}
@@ -0,0 +1,370 @@
{
"absolutePath": "a",
"id": 40,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 39,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"constant": false,
"id": 4,
"mutability": "mutable",
"name": "m",
"nodeType": "VariableDeclaration",
"src": "17:44:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 3,
"keyType":
{
"id": 1,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "25:7:1",
"typeDescriptions": {}
},
"nodeType": "Mapping",
"src": "17:35:1",
"typeDescriptions": {},
"valueType":
{
"id": 2,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "36:15:1",
"stateMutability": "payable",
"typeDescriptions": {}
}
},
"visibility": "public"
},
{
"body":
{
"id": 37,
"nodeType": "Block",
"src": "134:122:1",
"statements":
[
{
"assignments":
[
12
],
"declarations":
[
{
"constant": false,
"id": 12,
"mutability": "mutable",
"name": "a",
"nodeType": "VariableDeclaration",
"src": "144:17:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 11,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "144:15:1",
"stateMutability": "payable",
"typeDescriptions": {}
},
"visibility": "internal"
}
],
"id": 16,
"initialValue":
{
"baseExpression":
{
"id": 13,
"name": "m",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"src": "164:1:1",
"typeDescriptions": {}
},
"id": 15,
"indexExpression":
{
"id": 14,
"name": "arg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"src": "166:3:1",
"typeDescriptions": {}
},
"nodeType": "IndexAccess",
"src": "164:6:1",
"typeDescriptions": {}
},
"nodeType": "VariableDeclarationStatement",
"src": "144:26:1"
},
{
"expression":
{
"id": 19,
"leftHandSide":
{
"id": 17,
"name": "r",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"src": "180:1:1",
"typeDescriptions": {}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide":
{
"id": 18,
"name": "arg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"src": "184:3:1",
"typeDescriptions": {}
},
"src": "180:7:1",
"typeDescriptions": {}
},
"id": 20,
"nodeType": "ExpressionStatement",
"src": "180:7:1"
},
{
"assignments":
[
22
],
"declarations":
[
{
"constant": false,
"id": 22,
"mutability": "mutable",
"name": "c",
"nodeType": "VariableDeclaration",
"src": "197:9:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 21,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "197:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {}
},
"visibility": "internal"
}
],
"id": 27,
"initialValue":
{
"arguments":
[
{
"id": 25,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"src": "217:4:1",
"typeDescriptions": {}
}
],
"expression":
{
"id": 24,
"nodeType": "ElementaryTypeNameExpression",
"src": "209:7:1",
"typeDescriptions": {},
"typeName":
{
"id": 23,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "209:7:1",
"typeDescriptions": {}
}
},
"id": 26,
"names": [],
"nodeType": "FunctionCall",
"src": "209:13:1",
"tryCall": false,
"typeDescriptions": {}
},
"nodeType": "VariableDeclarationStatement",
"src": "197:25:1"
},
{
"expression":
{
"id": 35,
"leftHandSide":
{
"baseExpression":
{
"id": 28,
"name": "m",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"src": "232:1:1",
"typeDescriptions": {}
},
"id": 30,
"indexExpression":
{
"id": 29,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"src": "234:1:1",
"typeDescriptions": {}
},
"nodeType": "IndexAccess",
"src": "232:4:1",
"typeDescriptions": {}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide":
{
"arguments":
[
{
"hexValue": "30",
"id": 33,
"kind": "number",
"nodeType": "Literal",
"src": "247:1:1",
"typeDescriptions": {},
"value": "0"
}
],
"expression":
{
"id": 32,
"nodeType": "ElementaryTypeNameExpression",
"src": "239:7:1",
"typeDescriptions": {},
"typeName":
{
"id": 31,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "239:7:1",
"typeDescriptions": {}
}
},
"id": 34,
"names": [],
"nodeType": "FunctionCall",
"src": "239:10:1",
"tryCall": false,
"typeDescriptions": {}
},
"src": "232:17:1",
"typeDescriptions": {}
},
"id": 36,
"nodeType": "ExpressionStatement",
"src": "232:17:1"
}
]
},
"id": 38,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "f",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 7,
"nodeType": "ParameterList",
"parameters":
[
{
"constant": false,
"id": 6,
"mutability": "mutable",
"name": "arg",
"nodeType": "VariableDeclaration",
"src": "78:19:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 5,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "78:15:1",
"stateMutability": "payable",
"typeDescriptions": {}
},
"visibility": "internal"
}
],
"src": "77:21:1"
},
"returnParameters":
{
"id": 10,
"nodeType": "ParameterList",
"parameters":
[
{
"constant": false,
"id": 9,
"mutability": "mutable",
"name": "r",
"nodeType": "VariableDeclaration",
"src": "115:17:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 8,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "115:15:1",
"stateMutability": "payable",
"typeDescriptions": {}
},
"visibility": "internal"
}
],
"src": "114:19:1"
},
"src": "67:189:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"src": "0:258:1"
}
],
"src": "0:259:1"
}
@@ -0,0 +1,49 @@
{
"absolutePath": "a",
"id": 5,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 4,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"constant": false,
"id": 3,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"src": "13:8:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"baseType":
{
"id": 1,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "13:4:1",
"typeDescriptions": {}
},
"id": 2,
"nodeType": "ArrayTypeName",
"src": "13:6:1",
"typeDescriptions": {}
},
"visibility": "internal"
}
],
"src": "0:24:1"
}
],
"src": "0:25:1"
}
@@ -0,0 +1,152 @@
{
"absolutePath": "a",
"id": 7,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 6,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 4,
"nodeType": "Block",
"src": "37:59:1",
"statements":
[
{
"AST":
{
"nodeType": "YulBlock",
"src": "56:34:1",
"statements":
[
{
"expression":
{
"arguments":
[
{
"arguments":
[
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "67:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "70:1:1",
"type": "",
"value": "1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "73:1:1",
"type": "",
"value": "2"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "76:1:1",
"type": "",
"value": "3"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "79:1:1",
"type": "",
"value": "4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "82:1:1",
"type": "",
"value": "5"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "85:1:1",
"type": "",
"value": "6"
}
],
"functionName":
{
"name": "call",
"nodeType": "YulIdentifier",
"src": "62:4:1"
},
"nodeType": "YulFunctionCall",
"src": "62:25:1"
}
],
"functionName":
{
"name": "pop",
"nodeType": "YulIdentifier",
"src": "58:3:1"
},
"nodeType": "YulFunctionCall",
"src": "58:30:1"
},
"nodeType": "YulExpressionStatement",
"src": "58:30:1"
}
]
},
"evmVersion": %EVMVERSION%,
"externalReferences": [],
"id": 3,
"nodeType": "InlineAssembly",
"src": "47:43:1"
}
]
},
"id": 5,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "j",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "27:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "37:0:1"
},
"src": "17:79:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"src": "0:98:1"
}
],
"src": "0:99:1"
}
@@ -0,0 +1,77 @@
{
"absolutePath": "a",
"id": 7,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 6,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 4,
"nodeType": "Block",
"src": "42:31:1",
"statements":
[
{
"AST":
{
"nodeType": "YulBlock",
"src": "61:6:1",
"statements":
[
{
"nodeType": "YulBlock",
"src": "63:2:1",
"statements": []
}
]
},
"evmVersion": %EVMVERSION%,
"externalReferences": [],
"id": 3,
"nodeType": "InlineAssembly",
"src": "52:15:1"
}
]
},
"id": 5,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "g",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "27:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "42:0:1"
},
"src": "17:56:1",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
}
],
"src": "0:75:1"
}
],
"src": "0:76:1"
}
@@ -0,0 +1,139 @@
{
"absolutePath": "a",
"id": 7,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 6,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 4,
"nodeType": "Block",
"src": "42:68:1",
"statements":
[
{
"AST":
{
"nodeType": "YulBlock",
"src": "61:43:1",
"statements":
[
{
"body":
{
"nodeType": "YulBlock",
"src": "76:22:1",
"statements":
[
{
"expression":
{
"arguments":
[
{
"arguments":
[
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "92:2:1",
"type": "",
"value": "20"
}
],
"functionName":
{
"name": "blockhash",
"nodeType": "YulIdentifier",
"src": "82:9:1"
},
"nodeType": "YulFunctionCall",
"src": "82:13:1"
}
],
"functionName":
{
"name": "pop",
"nodeType": "YulIdentifier",
"src": "78:3:1"
},
"nodeType": "YulFunctionCall",
"src": "78:18:1"
},
"nodeType": "YulExpressionStatement",
"src": "78:18:1"
}
]
},
"name": "g",
"nodeType": "YulFunctionDefinition",
"src": "63:35:1"
},
{
"expression":
{
"arguments": [],
"functionName":
{
"name": "g",
"nodeType": "YulIdentifier",
"src": "99:1:1"
},
"nodeType": "YulFunctionCall",
"src": "99:3:1"
},
"nodeType": "YulExpressionStatement",
"src": "99:3:1"
}
]
},
"evmVersion": %EVMVERSION%,
"externalReferences": [],
"id": 3,
"nodeType": "InlineAssembly",
"src": "52:52:1"
}
]
},
"id": 5,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "h",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "27:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "42:0:1"
},
"src": "17:93:1",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
}
],
"src": "0:112:1"
}
],
"src": "0:113:1"
}
@@ -0,0 +1,89 @@
{
"absolutePath": "a",
"id": 7,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 6,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 4,
"nodeType": "Block",
"src": "37:51:1",
"statements":
[
{
"AST":
{
"nodeType": "YulBlock",
"src": "56:26:1",
"statements":
[
{
"body":
{
"nodeType": "YulBlock",
"src": "71:9:1",
"statements":
[
{
"nodeType": "YulLeave",
"src": "73:5:1"
}
]
},
"name": "f",
"nodeType": "YulFunctionDefinition",
"src": "58:22:1"
}
]
},
"evmVersion": %EVMVERSION%,
"externalReferences": [],
"id": 3,
"nodeType": "InlineAssembly",
"src": "47:35:1"
}
]
},
"id": 5,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "l",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "27:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "37:0:1"
},
"src": "17:71:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"src": "0:90:1"
}
],
"src": "0:91:1"
}
@@ -0,0 +1,152 @@
{
"absolutePath": "a",
"id": 7,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 6,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 4,
"nodeType": "Block",
"src": "42:74:1",
"statements":
[
{
"AST":
{
"nodeType": "YulBlock",
"src": "61:49:1",
"statements":
[
{
"body":
{
"nodeType": "YulBlock",
"src": "90:18:1",
"statements":
[
{
"nodeType": "YulBreak",
"src": "92:5:1"
},
{
"nodeType": "YulContinue",
"src": "98:8:1"
}
]
},
"condition":
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "70:1:1",
"type": "",
"value": "1"
},
"nodeType": "YulForLoop",
"post":
{
"nodeType": "YulBlock",
"src": "72:17:1",
"statements":
[
{
"expression":
{
"arguments":
[
{
"arguments":
[
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "84:1:1",
"type": "",
"value": "0"
}
],
"functionName":
{
"name": "sload",
"nodeType": "YulIdentifier",
"src": "78:5:1"
},
"nodeType": "YulFunctionCall",
"src": "78:8:1"
}
],
"functionName":
{
"name": "pop",
"nodeType": "YulIdentifier",
"src": "74:3:1"
},
"nodeType": "YulFunctionCall",
"src": "74:13:1"
},
"nodeType": "YulExpressionStatement",
"src": "74:13:1"
}
]
},
"pre":
{
"nodeType": "YulBlock",
"src": "67:2:1",
"statements": []
},
"src": "63:45:1"
}
]
},
"evmVersion": %EVMVERSION%,
"externalReferences": [],
"id": 3,
"nodeType": "InlineAssembly",
"src": "52:58:1"
}
]
},
"id": 5,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "g",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "27:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "42:0:1"
},
"src": "17:99:1",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
}
],
"src": "0:118:1"
}
],
"src": "0:119:1"
}
@@ -94,7 +94,6 @@
}
]
},
"functionSelector": "26121ff0",
"id": 7,
"implemented": true,
"kind": "function",
@@ -37,7 +37,6 @@
{
"attributes":
{
"functionSelector": "26121ff0",
"implemented": true,
"isConstructor": false,
"kind": "function",
@@ -0,0 +1,138 @@
{
"absolutePath": "a",
"id": 9,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 8,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 6,
"nodeType": "Block",
"src": "57:97:1",
"statements":
[
{
"AST":
{
"nodeType": "YulBlock",
"src": "72:78:1",
"statements":
[
{
"body":
{
"nodeType": "YulBlock",
"src": "94:50:1",
"statements":
[
{
"body":
{
"nodeType": "YulBlock",
"src": "118:3:1",
"statements": []
},
"name": "f2",
"nodeType": "YulFunctionDefinition",
"src": "104:17:1"
},
{
"nodeType": "YulAssignment",
"src": "130:6:1",
"value":
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "135:1:1",
"type": "",
"value": "2"
},
"variableNames":
[
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "130:1:1"
}
]
}
]
},
"name": "f1",
"nodeType": "YulFunctionDefinition",
"src": "80:64:1"
}
]
},
"evmVersion": %EVMVERSION%,
"externalReferences": [],
"id": 5,
"nodeType": "InlineAssembly",
"src": "63:87:1"
}
]
},
"id": 7,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "f",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "25:2:1"
},
"returnParameters":
{
"id": 4,
"nodeType": "ParameterList",
"parameters":
[
{
"constant": false,
"id": 3,
"mutability": "mutable",
"name": "x",
"nodeType": "VariableDeclaration",
"src": "49:6:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 2,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "49:4:1",
"typeDescriptions": {}
},
"visibility": "internal"
}
],
"src": "48:8:1"
},
"src": "15:139:1",
"stateMutability": "pure",
"virtual": false,
"visibility": "public"
}
],
"src": "0:156:1"
}
],
"src": "0:157:1"
}
@@ -0,0 +1,180 @@
{
"absolutePath": "a",
"id": 12,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 11,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"id": 3,
"members":
[
{
"constant": false,
"id": 2,
"mutability": "mutable",
"name": "x",
"nodeType": "VariableDeclaration",
"src": "28:6:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 1,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "28:4:1",
"typeDescriptions": {}
},
"visibility": "internal"
}
],
"name": "S",
"nodeType": "StructDefinition",
"src": "17:20:1",
"visibility": "public"
},
{
"constant": false,
"id": 5,
"mutability": "mutable",
"name": "s",
"nodeType": "VariableDeclaration",
"src": "42:3:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 4,
"name": "S",
"nodeType": "UserDefinedTypeName",
"src": "42:1:1",
"typeDescriptions": {}
},
"visibility": "internal"
},
{
"body":
{
"id": 9,
"nodeType": "Block",
"src": "76:70:1",
"statements":
[
{
"AST":
{
"nodeType": "YulBlock",
"src": "95:45:1",
"statements":
[
{
"nodeType": "YulVariableDeclaration",
"src": "97:17:1",
"value":
{
"name": "s.offset",
"nodeType": "YulIdentifier",
"src": "106:8:1"
},
"variables":
[
{
"name": "x",
"nodeType": "YulTypedName",
"src": "101:1:1",
"type": ""
}
]
},
{
"nodeType": "YulVariableDeclaration",
"src": "115:23:1",
"value":
{
"arguments":
[
{
"name": "s.slot",
"nodeType": "YulIdentifier",
"src": "128:6:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "136:1:1",
"type": "",
"value": "2"
}
],
"functionName":
{
"name": "mul",
"nodeType": "YulIdentifier",
"src": "124:3:1"
},
"nodeType": "YulFunctionCall",
"src": "124:14:1"
},
"variables":
[
{
"name": "y",
"nodeType": "YulTypedName",
"src": "119:1:1",
"type": ""
}
]
}
]
},
"evmVersion": %EVMVERSION%,
"externalReferences": [],
"id": 8,
"nodeType": "InlineAssembly",
"src": "86:54:1"
}
]
},
"id": 10,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "e",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 6,
"nodeType": "ParameterList",
"parameters": [],
"src": "61:2:1"
},
"returnParameters":
{
"id": 7,
"nodeType": "ParameterList",
"parameters": [],
"src": "76:0:1"
},
"src": "51:95:1",
"stateMutability": "pure",
"virtual": false,
"visibility": "public"
}
],
"src": "0:148:1"
}
],
"src": "0:149:1"
}
@@ -0,0 +1,93 @@
{
"absolutePath": "a",
"id": 7,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 6,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 4,
"nodeType": "Block",
"src": "37:43:1",
"statements":
[
{
"AST":
{
"nodeType": "YulBlock",
"src": "56:18:1",
"statements":
[
{
"nodeType": "YulVariableDeclaration",
"src": "58:14:1",
"value":
{
"kind": "string",
"nodeType": "YulLiteral",
"src": "67:5:1",
"type": "",
"value": "abc"
},
"variables":
[
{
"name": "x",
"nodeType": "YulTypedName",
"src": "62:1:1",
"type": ""
}
]
}
]
},
"evmVersion": %EVMVERSION%,
"externalReferences": [],
"id": 3,
"nodeType": "InlineAssembly",
"src": "47:27:1"
}
]
},
"id": 5,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "m",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "27:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "37:0:1"
},
"src": "17:63:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"src": "0:82:1"
}
],
"src": "0:83:1"
}
@@ -179,7 +179,6 @@
}
]
},
"functionSelector": "26121ff0",
"id": 5,
"implemented": true,
"kind": "function",
@@ -0,0 +1,116 @@
{
"absolutePath": "a",
"id": 7,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 6,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 4,
"nodeType": "Block",
"src": "42:58:1",
"statements":
[
{
"AST":
{
"nodeType": "YulBlock",
"src": "61:33:1",
"statements":
[
{
"cases":
[
{
"body":
{
"nodeType": "YulBlock",
"src": "79:2:1",
"statements": []
},
"nodeType": "YulCase",
"src": "72:9:1",
"value":
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "77:1:1",
"type": "",
"value": "0"
}
},
{
"body":
{
"nodeType": "YulBlock",
"src": "90:2:1",
"statements": []
},
"nodeType": "YulCase",
"src": "82:10:1",
"value": "default"
}
],
"expression":
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "70:1:1",
"type": "",
"value": "0"
},
"nodeType": "YulSwitch",
"src": "63:29:1"
}
]
},
"evmVersion": %EVMVERSION%,
"externalReferences": [],
"id": 3,
"nodeType": "InlineAssembly",
"src": "52:42:1"
}
]
},
"id": 5,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "g",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "27:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "42:0:1"
},
"src": "17:83:1",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
}
],
"src": "0:102:1"
}
],
"src": "0:103:1"
}
@@ -37,7 +37,6 @@
{
"attributes":
{
"functionSelector": "26121ff0",
"implemented": true,
"isConstructor": false,
"kind": "function",
@@ -0,0 +1,185 @@
{
"absolutePath": "a",
"id": 7,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 6,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 4,
"nodeType": "Block",
"src": "42:154:1",
"statements":
[
{
"AST":
{
"nodeType": "YulBlock",
"src": "61:129:1",
"statements":
[
{
"nodeType": "YulVariableDeclaration",
"src": "75:10:1",
"value":
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "84:1:1",
"type": "",
"value": "0"
},
"variables":
[
{
"name": "f",
"nodeType": "YulTypedName",
"src": "79:1:1",
"type": ""
}
]
},
{
"cases":
[
{
"body":
{
"nodeType": "YulBlock",
"src": "139:10:1",
"statements":
[
{
"nodeType": "YulAssignment",
"src": "141:6:1",
"value":
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "146:1:1",
"type": "",
"value": "1"
},
"variableNames":
[
{
"name": "f",
"nodeType": "YulIdentifier",
"src": "141:1:1"
}
]
}
]
},
"nodeType": "YulCase",
"src": "132:17:1",
"value":
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "137:1:1",
"type": "",
"value": "0"
}
},
{
"body":
{
"nodeType": "YulBlock",
"src": "170:10:1",
"statements":
[
{
"nodeType": "YulAssignment",
"src": "172:6:1",
"value":
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "177:1:1",
"type": "",
"value": "2"
},
"variableNames":
[
{
"name": "f",
"nodeType": "YulIdentifier",
"src": "172:1:1"
}
]
}
]
},
"nodeType": "YulCase",
"src": "162:18:1",
"value": "default"
}
],
"expression":
{
"arguments": [],
"functionName":
{
"name": "calldatasize",
"nodeType": "YulIdentifier",
"src": "105:12:1"
},
"nodeType": "YulFunctionCall",
"src": "105:14:1"
},
"nodeType": "YulSwitch",
"src": "98:82:1"
}
]
},
"evmVersion": %EVMVERSION%,
"externalReferences": [],
"id": 3,
"nodeType": "InlineAssembly",
"src": "52:138:1"
}
]
},
"id": 5,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "f",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "27:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "42:0:1"
},
"src": "17:179:1",
"stateMutability": "pure",
"virtual": false,
"visibility": "public"
}
],
"src": "0:198:1"
}
],
"src": "0:199:1"
}
@@ -0,0 +1,124 @@
{
"absolutePath": "a",
"id": 10,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 9,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 7,
"nodeType": "Block",
"src": "42:51:1",
"statements":
[
{
"assignments":
[
4
],
"declarations":
[
{
"constant": false,
"id": 4,
"mutability": "mutable",
"name": "x",
"nodeType": "VariableDeclaration",
"src": "52:6:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 3,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "52:4:1",
"typeDescriptions": {}
},
"visibility": "internal"
}
],
"id": 5,
"nodeType": "VariableDeclarationStatement",
"src": "52:6:1"
},
{
"AST":
{
"nodeType": "YulBlock",
"src": "77:10:1",
"statements":
[
{
"nodeType": "YulAssignment",
"src": "79:6:1",
"value":
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "84:1:1",
"type": "",
"value": "7"
},
"variableNames":
[
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "79:1:1"
}
]
}
]
},
"evmVersion": %EVMVERSION%,
"externalReferences": [],
"id": 6,
"nodeType": "InlineAssembly",
"src": "68:19:1"
}
]
},
"id": 8,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "f",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "27:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "42:0:1"
},
"src": "17:76:1",
"stateMutability": "pure",
"virtual": false,
"visibility": "public"
}
],
"src": "0:95:1"
}
],
"src": "0:96:1"
}
@@ -0,0 +1,54 @@
{
"absolutePath": "a",
"id": 6,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 5,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 3,
"nodeType": "Block",
"src": "28:4:1",
"statements": []
},
"id": 4,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "25:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "28:0:1"
},
"src": "14:18:1",
"stateMutability": "nonpayable",
"virtual": false
}
],
"src": "0:34:1"
}
],
"src": "0:35:1"
}
@@ -0,0 +1,124 @@
{
"absolutePath": "a",
"id": 14,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 1,
"name": "A",
"nodeType": "ContractDefinition",
"nodes": [],
"src": "0:14:1"
},
{
"abstract": false,
"baseContracts":
[
{
"baseName":
{
"id": 2,
"name": "A",
"nodeType": "UserDefinedTypeName",
"src": "29:1:1",
"typeDescriptions": {}
},
"id": 3,
"nodeType": "InheritanceSpecifier",
"src": "29:1:1"
}
],
"contractDependencies": [],
"contractKind": "contract",
"id": 4,
"name": "B",
"nodeType": "ContractDefinition",
"nodes": [],
"src": "15:19:1"
},
{
"abstract": false,
"baseContracts":
[
{
"baseName":
{
"id": 5,
"name": "B",
"nodeType": "UserDefinedTypeName",
"src": "49:1:1",
"typeDescriptions": {}
},
"id": 6,
"nodeType": "InheritanceSpecifier",
"src": "49:1:1"
}
],
"contractDependencies": [],
"contractKind": "contract",
"id": 7,
"name": "C",
"nodeType": "ContractDefinition",
"nodes": [],
"src": "35:19:1"
},
{
"abstract": false,
"baseContracts":
[
{
"baseName":
{
"id": 8,
"name": "C",
"nodeType": "UserDefinedTypeName",
"src": "69:1:1",
"typeDescriptions": {}
},
"id": 9,
"nodeType": "InheritanceSpecifier",
"src": "69:1:1"
}
],
"contractDependencies": [],
"contractKind": "contract",
"id": 10,
"name": "D",
"nodeType": "ContractDefinition",
"nodes": [],
"src": "55:19:1"
},
{
"abstract": false,
"baseContracts":
[
{
"baseName":
{
"id": 11,
"name": "D",
"nodeType": "UserDefinedTypeName",
"src": "89:1:1",
"typeDescriptions": {}
},
"id": 12,
"nodeType": "InheritanceSpecifier",
"src": "89:1:1"
}
],
"contractDependencies": [],
"contractKind": "contract",
"id": 13,
"name": "E",
"nodeType": "ContractDefinition",
"nodes": [],
"src": "75:19:1"
}
],
"src": "0:95:1"
}
@@ -0,0 +1,195 @@
[
{
"absolutePath": "a",
"id": 3,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation":
{
"id": 1,
"nodeType": "StructuredDocumentation",
"src": "0:27:1",
"text": "This contract is empty"
},
"id": 2,
"name": "C",
"nodeType": "ContractDefinition",
"nodes": [],
"src": "28:13:1"
}
],
"src": "28:14:1"
},
{
"absolutePath": "b",
"id": 6,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation":
{
"id": 4,
"nodeType": "StructuredDocumentation",
"src": "0:61:2",
"text": "This contract is empty\nand has a line-breaking comment."
},
"id": 5,
"name": "C",
"nodeType": "ContractDefinition",
"nodes": [],
"src": "62:13:2"
}
],
"src": "62:14:2"
},
{
"absolutePath": "c",
"id": 24,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 23,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"constant": false,
"id": 9,
"mutability": "mutable",
"name": "state",
"nodeType": "VariableDeclaration",
"src": "48:17:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 8,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "48:4:3",
"typeDescriptions": {}
},
"visibility": "public"
},
{
"anonymous": false,
"documentation":
{
"id": 10,
"nodeType": "StructuredDocumentation",
"src": "69:26:3",
"text": "Some comment on Evt."
},
"id": 12,
"name": "Evt",
"nodeType": "EventDefinition",
"parameters":
{
"id": 11,
"nodeType": "ParameterList",
"parameters": [],
"src": "105:2:3"
},
"src": "96:12:3"
},
{
"body":
{
"id": 16,
"nodeType": "Block",
"src": "153:6:3",
"statements":
[
{
"id": 15,
"nodeType": "PlaceholderStatement",
"src": "155:1:3"
}
]
},
"documentation":
{
"id": 13,
"nodeType": "StructuredDocumentation",
"src": "111:26:3",
"text": "Some comment on mod."
},
"id": 17,
"name": "mod",
"nodeType": "ModifierDefinition",
"parameters":
{
"id": 14,
"nodeType": "ParameterList",
"parameters": [],
"src": "150:2:3"
},
"src": "138:21:3",
"virtual": false,
"visibility": "internal"
},
{
"body":
{
"id": 21,
"nodeType": "Block",
"src": "209:2:3",
"statements": []
},
"documentation":
{
"id": 18,
"nodeType": "StructuredDocumentation",
"src": "162:25:3",
"text": "Some comment on fn."
},
"id": 22,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "fn",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 19,
"nodeType": "ParameterList",
"parameters": [],
"src": "199:2:3"
},
"returnParameters":
{
"id": 20,
"nodeType": "ParameterList",
"parameters": [],
"src": "209:0:3"
},
"src": "188:23:3",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"src": "0:213:3"
}
],
"src": "0:214:3"
}
]
@@ -0,0 +1,43 @@
{
"absolutePath": "a",
"id": 5,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 4,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"id": 3,
"members":
[
{
"id": 1,
"name": "A",
"nodeType": "EnumValue",
"src": "22:1:1"
},
{
"id": 2,
"name": "B",
"nodeType": "EnumValue",
"src": "25:1:1"
}
],
"name": "E",
"nodeType": "EnumDefinition",
"src": "13:15:1"
}
],
"src": "0:30:1"
}
],
"src": "0:31:1"
}
@@ -0,0 +1,36 @@
{
"absolutePath": "a",
"id": 4,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 3,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"anonymous": false,
"id": 2,
"name": "E",
"nodeType": "EventDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "20:2:1"
},
"src": "13:10:1"
}
],
"src": "0:25:1"
}
],
"src": "0:26:1"
}
@@ -0,0 +1,88 @@
{
"absolutePath": "a",
"id": 10,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 9,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 3,
"nodeType": "Block",
"src": "42:5:1",
"statements": []
},
"id": 4,
"implemented": true,
"kind": "receive",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "22:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "42:0:1"
},
"src": "15:32:1",
"stateMutability": "payable",
"virtual": false,
"visibility": "external"
},
{
"body":
{
"id": 7,
"nodeType": "Block",
"src": "78:5:1",
"statements": []
},
"id": 8,
"implemented": true,
"kind": "fallback",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 5,
"nodeType": "ParameterList",
"parameters": [],
"src": "58:2:1"
},
"returnParameters":
{
"id": 6,
"nodeType": "ParameterList",
"parameters": [],
"src": "78:0:1"
},
"src": "50:33:1",
"stateMutability": "payable",
"virtual": false,
"visibility": "external"
}
],
"src": "0:85:1"
}
],
"src": "0:86:1"
}
@@ -0,0 +1,55 @@
{
"absolutePath": "a",
"id": 6,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 5,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 3,
"nodeType": "Block",
"src": "43:5:1",
"statements": []
},
"id": 4,
"implemented": true,
"kind": "fallback",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "23:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "43:0:1"
},
"src": "15:33:1",
"stateMutability": "payable",
"virtual": false,
"visibility": "external"
}
],
"src": "0:50:1"
}
],
"src": "0:51:1"
}
@@ -0,0 +1,55 @@
{
"absolutePath": "a",
"id": 6,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 5,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 3,
"nodeType": "Block",
"src": "34:2:1",
"statements": []
},
"id": 4,
"implemented": true,
"kind": "fallback",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "22:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "34:0:1"
},
"src": "14:22:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
}
],
"src": "0:38:1"
}
],
"src": "0:39:1"
}
@@ -0,0 +1,173 @@
{
"absolutePath": "a",
"id": 18,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 17,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 15,
"nodeType": "Block",
"src": "120:2:1",
"statements": []
},
"id": 16,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "f",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 7,
"nodeType": "ParameterList",
"parameters":
[
{
"constant": false,
"id": 6,
"mutability": "mutable",
"name": "x",
"nodeType": "VariableDeclaration",
"src": "24:44:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 5,
"nodeType": "FunctionTypeName",
"parameterTypes":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "32:2:1"
},
"returnParameterTypes":
{
"id": 4,
"nodeType": "ParameterList",
"parameters":
[
{
"constant": false,
"id": 3,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"src": "61:4:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 2,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "61:4:1",
"typeDescriptions": {}
},
"visibility": "internal"
}
],
"src": "60:6:1"
},
"src": "24:44:1",
"stateMutability": "payable",
"typeDescriptions": {},
"visibility": "external"
},
"visibility": "internal"
}
],
"src": "23:46:1"
},
"returnParameters":
{
"id": 14,
"nodeType": "ParameterList",
"parameters":
[
{
"constant": false,
"id": 13,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"src": "79:40:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 12,
"nodeType": "FunctionTypeName",
"parameterTypes":
{
"id": 8,
"nodeType": "ParameterList",
"parameters": [],
"src": "87:2:1"
},
"returnParameterTypes":
{
"id": 11,
"nodeType": "ParameterList",
"parameters":
[
{
"constant": false,
"id": 10,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"src": "113:4:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 9,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "113:4:1",
"typeDescriptions": {}
},
"visibility": "internal"
}
],
"src": "112:6:1"
},
"src": "79:40:1",
"stateMutability": "view",
"typeDescriptions": {},
"visibility": "external"
},
"visibility": "internal"
}
],
"src": "78:41:1"
},
"src": "13:109:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"src": "0:124:1"
}
],
"src": "0:125:1"
}
@@ -0,0 +1,24 @@
{
"absolutePath": "a",
"id": 3,
"nodeType": "SourceUnit",
"nodes":
[
{
"id": 2,
"members":
[
{
"id": 1,
"name": "A",
"nodeType": "EnumValue",
"src": "9:1:1"
}
],
"name": "E",
"nodeType": "EnumDefinition",
"src": "0:12:1"
}
],
"src": "0:13:1"
}
@@ -0,0 +1,39 @@
{
"absolutePath": "a",
"id": 4,
"nodeType": "SourceUnit",
"nodes":
[
{
"id": 3,
"members":
[
{
"constant": false,
"id": 2,
"mutability": "mutable",
"name": "a",
"nodeType": "VariableDeclaration",
"src": "11:9:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 1,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "11:7:1",
"typeDescriptions": {}
},
"visibility": "internal"
}
],
"name": "S",
"nodeType": "StructDefinition",
"src": "0:23:1",
"visibility": "public"
}
],
"src": "0:24:1"
}
@@ -0,0 +1,46 @@
{
"absolutePath": "a",
"id": 5,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 1,
"name": "C1",
"nodeType": "ContractDefinition",
"nodes": [],
"src": "0:14:1"
},
{
"abstract": false,
"baseContracts":
[
{
"baseName":
{
"id": 2,
"name": "C1",
"nodeType": "UserDefinedTypeName",
"src": "30:2:1",
"typeDescriptions": {}
},
"id": 3,
"nodeType": "InheritanceSpecifier",
"src": "30:2:1"
}
],
"contractDependencies": [],
"contractKind": "contract",
"id": 4,
"name": "C2",
"nodeType": "ContractDefinition",
"nodes": [],
"src": "15:20:1"
}
],
"src": "0:36:1"
}
@@ -0,0 +1,21 @@
{
"absolutePath": "a",
"id": 2,
"license": "GPL-3.0",
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 1,
"name": "C",
"nodeType": "ContractDefinition",
"nodes": [],
"src": "36:13:1"
}
],
"src": "36:14:1"
}
@@ -0,0 +1,118 @@
{
"absolutePath": "a",
"id": 12,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 11,
"name": "c",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 9,
"nodeType": "Block",
"src": "33:19:1",
"statements":
[
{
"assignments":
[
4
],
"declarations":
[
{
"constant": false,
"id": 4,
"mutability": "mutable",
"name": "a",
"nodeType": "VariableDeclaration",
"src": "35:6:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 3,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "35:4:1",
"typeDescriptions": {}
},
"visibility": "internal"
}
],
"id": 8,
"initialValue":
{
"commonType": {},
"id": 7,
"leftExpression":
{
"hexValue": "32",
"id": 5,
"kind": "number",
"nodeType": "Literal",
"src": "44:1:1",
"typeDescriptions": {},
"value": "2"
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression":
{
"hexValue": "33",
"id": 6,
"kind": "number",
"nodeType": "Literal",
"src": "48:1:1",
"typeDescriptions": {},
"value": "3"
},
"src": "44:5:1",
"typeDescriptions": {}
},
"nodeType": "VariableDeclarationStatement",
"src": "35:14:1"
}
]
},
"id": 10,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "f",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "23:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "33:0:1"
},
"src": "13:39:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"src": "0:54:1"
}
],
"src": "0:55:1"
}
@@ -0,0 +1,132 @@
{
"absolutePath": "a",
"id": 16,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 15,
"name": "c",
"nodeType": "ContractDefinition",
"nodes":
[
{
"constant": false,
"id": 3,
"mutability": "mutable",
"name": "a",
"nodeType": "VariableDeclaration",
"src": "13:8:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"baseType":
{
"id": 1,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "13:4:1",
"typeDescriptions": {}
},
"id": 2,
"nodeType": "ArrayTypeName",
"src": "13:6:1",
"typeDescriptions": {}
},
"visibility": "internal"
},
{
"body":
{
"id": 13,
"nodeType": "Block",
"src": "43:25:1",
"statements":
[
{
"assignments":
[
10
],
"declarations":
[
{
"constant": false,
"id": 10,
"mutability": "mutable",
"name": "b",
"nodeType": "VariableDeclaration",
"src": "45:16:1",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {},
"typeName":
{
"baseType":
{
"id": 8,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "45:4:1",
"typeDescriptions": {}
},
"id": 9,
"nodeType": "ArrayTypeName",
"src": "45:6:1",
"typeDescriptions": {}
},
"visibility": "internal"
}
],
"id": 12,
"initialValue":
{
"id": 11,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"src": "64:1:1",
"typeDescriptions": {}
},
"nodeType": "VariableDeclarationStatement",
"src": "45:20:1"
}
]
},
"id": 14,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "f",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 4,
"nodeType": "ParameterList",
"parameters": [],
"src": "33:2:1"
},
"returnParameters":
{
"id": 5,
"nodeType": "ParameterList",
"parameters": [],
"src": "43:0:1"
},
"src": "23:45:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"src": "0:70:1"
}
],
"src": "0:71:1"
}
@@ -0,0 +1,154 @@
{
"absolutePath": "a",
"id": 18,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 17,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"id": 4,
"members":
[
{
"id": 1,
"name": "A",
"nodeType": "EnumValue",
"src": "26:1:1"
},
{
"id": 2,
"name": "B",
"nodeType": "EnumValue",
"src": "29:1:1"
},
{
"id": 3,
"name": "C",
"nodeType": "EnumValue",
"src": "32:1:1"
}
],
"name": "E",
"nodeType": "EnumDefinition",
"src": "17:18:1"
},
{
"constant": false,
"id": 8,
"mutability": "mutable",
"name": "a",
"nodeType": "VariableDeclaration",
"src": "40:20:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 7,
"keyType":
{
"id": 5,
"name": "C",
"nodeType": "UserDefinedTypeName",
"src": "48:1:1",
"typeDescriptions": {}
},
"nodeType": "Mapping",
"src": "40:18:1",
"typeDescriptions": {},
"valueType":
{
"id": 6,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "53:4:1",
"typeDescriptions": {}
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 12,
"mutability": "mutable",
"name": "b",
"nodeType": "VariableDeclaration",
"src": "66:26:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 11,
"keyType":
{
"id": 9,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "74:7:1",
"typeDescriptions": {}
},
"nodeType": "Mapping",
"src": "66:24:1",
"typeDescriptions": {},
"valueType":
{
"id": 10,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "85:4:1",
"typeDescriptions": {}
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 16,
"mutability": "mutable",
"name": "c",
"nodeType": "VariableDeclaration",
"src": "98:20:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 15,
"keyType":
{
"id": 13,
"name": "E",
"nodeType": "UserDefinedTypeName",
"src": "106:1:1",
"typeDescriptions": {}
},
"nodeType": "Mapping",
"src": "98:18:1",
"typeDescriptions": {},
"valueType":
{
"id": 14,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "111:4:1",
"typeDescriptions": {}
}
},
"visibility": "internal"
}
],
"src": "0:121:1"
}
],
"src": "0:122:1"
}
@@ -0,0 +1,134 @@
{
"absolutePath": "a",
"id": 15,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 14,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 5,
"nodeType": "Block",
"src": "32:6:1",
"statements":
[
{
"id": 4,
"nodeType": "PlaceholderStatement",
"src": "34:1:1"
}
]
},
"id": 6,
"name": "M",
"nodeType": "ModifierDefinition",
"parameters":
{
"id": 3,
"nodeType": "ParameterList",
"parameters":
[
{
"constant": false,
"id": 2,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"src": "24:6:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 1,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "24:4:1",
"typeDescriptions": {}
},
"visibility": "internal"
}
],
"src": "23:8:1"
},
"src": "13:25:1",
"virtual": false,
"visibility": "internal"
},
{
"body":
{
"id": 12,
"nodeType": "Block",
"src": "64:2:1",
"statements": []
},
"id": 13,
"implemented": true,
"kind": "function",
"modifiers":
[
{
"arguments":
[
{
"hexValue": "31",
"id": 9,
"kind": "number",
"nodeType": "Literal",
"src": "54:1:1",
"typeDescriptions": {},
"value": "1"
}
],
"id": 10,
"modifierName":
{
"id": 8,
"name": "M",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"src": "52:1:1",
"typeDescriptions": {}
},
"nodeType": "ModifierInvocation",
"src": "52:4:1"
}
],
"name": "F",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 7,
"nodeType": "ParameterList",
"parameters": [],
"src": "49:2:1"
},
"returnParameters":
{
"id": 11,
"nodeType": "ParameterList",
"parameters": [],
"src": "64:0:1"
},
"src": "39:27:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"src": "0:68:1"
}
],
"src": "0:69:1"
}
@@ -0,0 +1,134 @@
{
"absolutePath": "a",
"id": 15,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 14,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 5,
"nodeType": "Block",
"src": "32:6:1",
"statements":
[
{
"id": 4,
"nodeType": "PlaceholderStatement",
"src": "34:1:1"
}
]
},
"id": 6,
"name": "M",
"nodeType": "ModifierDefinition",
"parameters":
{
"id": 3,
"nodeType": "ParameterList",
"parameters":
[
{
"constant": false,
"id": 2,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"src": "24:6:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 1,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "24:4:1",
"typeDescriptions": {}
},
"visibility": "internal"
}
],
"src": "23:8:1"
},
"src": "13:25:1",
"virtual": false,
"visibility": "internal"
},
{
"body":
{
"id": 12,
"nodeType": "Block",
"src": "64:2:1",
"statements": []
},
"id": 13,
"implemented": true,
"kind": "function",
"modifiers":
[
{
"arguments":
[
{
"hexValue": "31",
"id": 9,
"kind": "number",
"nodeType": "Literal",
"src": "54:1:1",
"typeDescriptions": {},
"value": "1"
}
],
"id": 10,
"modifierName":
{
"id": 8,
"name": "M",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"src": "52:1:1",
"typeDescriptions": {}
},
"nodeType": "ModifierInvocation",
"src": "52:4:1"
}
],
"name": "F",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 7,
"nodeType": "ParameterList",
"parameters": [],
"src": "49:2:1"
},
"returnParameters":
{
"id": 11,
"nodeType": "ParameterList",
"parameters": [],
"src": "64:0:1"
},
"src": "39:27:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"src": "0:68:1"
}
],
"src": "0:69:1"
}
@@ -0,0 +1,112 @@
{
"absolutePath": "a",
"id": 11,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 10,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"constant": false,
"id": 3,
"mutability": "immutable",
"name": "a",
"nodeType": "VariableDeclaration",
"src": "17:27:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 1,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "17:4:1",
"typeDescriptions": {}
},
"value":
{
"hexValue": "34",
"id": 2,
"kind": "number",
"nodeType": "Literal",
"src": "43:1:1",
"typeDescriptions": {},
"value": "4"
},
"visibility": "public"
},
{
"constant": true,
"id": 6,
"mutability": "constant",
"name": "b",
"nodeType": "VariableDeclaration",
"src": "50:26:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 4,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "50:4:1",
"typeDescriptions": {}
},
"value":
{
"hexValue": "32",
"id": 5,
"kind": "number",
"nodeType": "Literal",
"src": "75:1:1",
"typeDescriptions": {},
"value": "2"
},
"visibility": "public"
},
{
"constant": false,
"id": 9,
"mutability": "mutable",
"name": "c",
"nodeType": "VariableDeclaration",
"src": "82:17:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 7,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "82:4:1",
"typeDescriptions": {}
},
"value":
{
"hexValue": "33",
"id": 8,
"kind": "number",
"nodeType": "Literal",
"src": "98:1:1",
"typeDescriptions": {},
"value": "3"
},
"visibility": "public"
}
],
"src": "0:102:1"
}
],
"src": "0:103:1"
}
@@ -0,0 +1,98 @@
{
"absolutePath": "a",
"id": 10,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 9,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 7,
"nodeType": "Block",
"src": "33:30:1",
"statements":
[
{
"assignments":
[
4
],
"declarations":
[
{
"constant": false,
"id": 4,
"mutability": "mutable",
"name": "x",
"nodeType": "VariableDeclaration",
"src": "35:15:1",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {},
"typeName":
{
"id": 3,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "35:6:1",
"typeDescriptions": {}
},
"visibility": "internal"
}
],
"id": 6,
"initialValue":
{
"hexValue": "ff",
"id": 5,
"kind": "hexString",
"nodeType": "Literal",
"src": "53:7:1",
"typeDescriptions": {}
},
"nodeType": "VariableDeclarationStatement",
"src": "35:25:1"
}
]
},
"id": 8,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "f",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "23:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "33:0:1"
},
"src": "13:50:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"src": "0:65:1"
}
],
"src": "0:66:1"
}
@@ -0,0 +1,8 @@
import "notexisting.sol" as NotExisting;
contract C is NotExisting.X
{
NotExisting.SomeStruct public myStruct;
constructor() {}
}
// ----
@@ -0,0 +1,97 @@
{
"absolutePath": "a",
"id": 11,
"nodeType": "SourceUnit",
"nodes":
[
{
"file": "notexisting.sol",
"id": 1,
"nodeType": "ImportDirective",
"src": "0:40:1",
"symbolAliases": [],
"unitAlias": "NotExisting"
},
{
"abstract": false,
"baseContracts":
[
{
"baseName":
{
"id": 2,
"name": "NotExisting.X",
"nodeType": "UserDefinedTypeName",
"src": "55:13:1",
"typeDescriptions": {}
},
"id": 3,
"nodeType": "InheritanceSpecifier",
"src": "55:13:1"
}
],
"contractDependencies": [],
"contractKind": "contract",
"id": 10,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"constant": false,
"id": 5,
"mutability": "mutable",
"name": "myStruct",
"nodeType": "VariableDeclaration",
"src": "72:38:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 4,
"name": "NotExisting.SomeStruct",
"nodeType": "UserDefinedTypeName",
"src": "72:22:1",
"typeDescriptions": {}
},
"visibility": "public"
},
{
"body":
{
"id": 8,
"nodeType": "Block",
"src": "127:2:1",
"statements": []
},
"id": 9,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 6,
"nodeType": "ParameterList",
"parameters": [],
"src": "124:2:1"
},
"returnParameters":
{
"id": 7,
"nodeType": "ParameterList",
"parameters": [],
"src": "127:0:1"
},
"src": "113:16:1",
"stateMutability": "nonpayable",
"virtual": false
}
],
"src": "41:90:1"
}
],
"src": "0:132:1"
}
@@ -0,0 +1,273 @@
{
"absolutePath": "a",
"id": 32,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 5,
"name": "A",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 3,
"nodeType": "Block",
"src": "36:2:1",
"statements": []
},
"id": 4,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "faa",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "26:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "36:0:1"
},
"src": "14:24:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"src": "0:40:1"
},
{
"abstract": false,
"baseContracts":
[
{
"baseName":
{
"id": 6,
"name": "A",
"nodeType": "UserDefinedTypeName",
"src": "55:1:1",
"typeDescriptions": {}
},
"id": 7,
"nodeType": "InheritanceSpecifier",
"src": "55:1:1"
}
],
"contractDependencies": [],
"contractKind": "contract",
"id": 16,
"name": "B",
"nodeType": "ContractDefinition",
"nodes":
[
{
"id": 10,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "foo",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 8,
"nodeType": "ParameterList",
"parameters": [],
"src": "72:2:1"
},
"returnParameters":
{
"id": 9,
"nodeType": "ParameterList",
"parameters": [],
"src": "81:0:1"
},
"src": "60:22:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body":
{
"id": 14,
"nodeType": "Block",
"src": "115:2:1",
"statements": []
},
"id": 15,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "faa",
"nodeType": "FunctionDefinition",
"overrides":
{
"id": 12,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "106:8:1"
},
"parameters":
{
"id": 11,
"nodeType": "ParameterList",
"parameters": [],
"src": "96:2:1"
},
"returnParameters":
{
"id": 13,
"nodeType": "ParameterList",
"parameters": [],
"src": "115:0:1"
},
"src": "84:33:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"src": "41:78:1"
},
{
"abstract": false,
"baseContracts":
[
{
"baseName":
{
"id": 17,
"name": "B",
"nodeType": "UserDefinedTypeName",
"src": "134:1:1",
"typeDescriptions": {}
},
"id": 18,
"nodeType": "InheritanceSpecifier",
"src": "134:1:1"
}
],
"contractDependencies": [],
"contractKind": "contract",
"id": 31,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 22,
"nodeType": "Block",
"src": "170:3:1",
"statements": []
},
"id": 23,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "foo",
"nodeType": "FunctionDefinition",
"overrides":
{
"id": 20,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "161:8:1"
},
"parameters":
{
"id": 19,
"nodeType": "ParameterList",
"parameters": [],
"src": "151:2:1"
},
"returnParameters":
{
"id": 21,
"nodeType": "ParameterList",
"parameters": [],
"src": "170:0:1"
},
"src": "139:34:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body":
{
"id": 29,
"nodeType": "Block",
"src": "212:2:1",
"statements": []
},
"id": 30,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "faa",
"nodeType": "FunctionDefinition",
"overrides":
{
"id": 27,
"nodeType": "OverrideSpecifier",
"overrides":
[
{
"id": 25,
"name": "A",
"nodeType": "UserDefinedTypeName",
"src": "206:1:1",
"typeDescriptions": {}
},
{
"id": 26,
"name": "B",
"nodeType": "UserDefinedTypeName",
"src": "209:1:1",
"typeDescriptions": {}
}
],
"src": "197:14:1"
},
"parameters":
{
"id": 24,
"nodeType": "ParameterList",
"parameters": [],
"src": "187:2:1"
},
"returnParameters":
{
"id": 28,
"nodeType": "ParameterList",
"parameters": [],
"src": "212:0:1"
},
"src": "175:39:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"src": "120:96:1"
}
],
"src": "0:217:1"
}
@@ -0,0 +1,51 @@
{
"absolutePath": "a",
"id": 6,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 5,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 3,
"nodeType": "Block",
"src": "24:6:1",
"statements":
[
{
"id": 2,
"nodeType": "PlaceholderStatement",
"src": "26:1:1"
}
]
},
"id": 4,
"name": "M",
"nodeType": "ModifierDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "24:0:1"
},
"src": "13:17:1",
"virtual": false,
"visibility": "internal"
}
],
"src": "0:32:1"
}
],
"src": "0:33:1"
}
@@ -0,0 +1,55 @@
{
"absolutePath": "a",
"id": 6,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 5,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 3,
"nodeType": "Block",
"src": "42:5:1",
"statements": []
},
"id": 4,
"implemented": true,
"kind": "receive",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "22:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "42:0:1"
},
"src": "15:32:1",
"stateMutability": "payable",
"virtual": false,
"visibility": "external"
}
],
"src": "0:49:1"
}
],
"src": "0:50:1"
}
@@ -0,0 +1,96 @@
{
"absolutePath": "a",
"id": 12,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 11,
"name": "c",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 9,
"nodeType": "Block",
"src": "33:20:1",
"statements":
[
{
"assignments":
[
7
],
"declarations":
[
{
"constant": false,
"id": 7,
"mutability": "mutable",
"name": "x",
"nodeType": "VariableDeclaration",
"src": "35:15:1",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {},
"typeName":
{
"baseType":
{
"id": 5,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "35:4:1",
"typeDescriptions": {}
},
"id": 6,
"nodeType": "ArrayTypeName",
"src": "35:6:1",
"typeDescriptions": {}
},
"visibility": "internal"
}
],
"id": 8,
"nodeType": "VariableDeclarationStatement",
"src": "35:15:1"
}
]
},
"id": 10,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "f",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "23:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "33:0:1"
},
"src": "13:40:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"src": "0:55:1"
}
],
"src": "0:56:1"
}
@@ -0,0 +1,103 @@
{
"absolutePath": "a",
"id": 13,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 12,
"name": "c",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 10,
"nodeType": "Block",
"src": "33:25:1",
"statements":
[
{
"assignments":
[
8
],
"declarations":
[
{
"constant": false,
"id": 8,
"mutability": "mutable",
"name": "rows",
"nodeType": "VariableDeclaration",
"src": "35:20:1",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {},
"typeName":
{
"baseType":
{
"baseType":
{
"id": 5,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "35:4:1",
"typeDescriptions": {}
},
"id": 6,
"nodeType": "ArrayTypeName",
"src": "35:6:1",
"typeDescriptions": {}
},
"id": 7,
"nodeType": "ArrayTypeName",
"src": "35:8:1",
"typeDescriptions": {}
},
"visibility": "internal"
}
],
"id": 9,
"nodeType": "VariableDeclarationStatement",
"src": "35:20:1"
}
]
},
"id": 11,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "f",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "23:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "33:0:1"
},
"src": "13:45:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"src": "0:60:1"
}
],
"src": "0:61:1"
}
@@ -0,0 +1,20 @@
{
"absolutePath": "a",
"id": 2,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 1,
"name": "C",
"nodeType": "ContractDefinition",
"nodes": [],
"src": "0:13:1"
}
],
"src": "0:14:1"
}
@@ -0,0 +1,122 @@
{
"absolutePath": "a",
"id": 13,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 12,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 10,
"nodeType": "Block",
"src": "26:20:1",
"statements":
[
{
"assignments":
[
4
],
"declarations":
[
{
"constant": false,
"id": 4,
"mutability": "mutable",
"name": "x",
"nodeType": "VariableDeclaration",
"src": "28:6:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeName":
{
"id": 3,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "28:4:1",
"typeDescriptions": {}
},
"visibility": "internal"
}
],
"id": 6,
"initialValue":
{
"hexValue": "32",
"id": 5,
"kind": "number",
"nodeType": "Literal",
"src": "37:1:1",
"typeDescriptions": {},
"value": "2"
},
"nodeType": "VariableDeclarationStatement",
"src": "28:10:1"
},
{
"expression":
{
"id": 8,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "40:3:1",
"subExpression":
{
"id": 7,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"src": "40:1:1",
"typeDescriptions": {}
},
"typeDescriptions": {}
},
"id": 9,
"nodeType": "ExpressionStatement",
"src": "40:3:1"
}
]
},
"id": 11,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "f",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "23:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "26:0:1"
},
"src": "13:33:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"src": "0:48:1"
}
],
"src": "0:49:1"
}
@@ -0,0 +1,99 @@
{
"absolutePath": "a",
"id": 10,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 9,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 7,
"nodeType": "Block",
"src": "33:36:1",
"statements":
[
{
"assignments":
[
4
],
"declarations":
[
{
"constant": false,
"id": 4,
"mutability": "mutable",
"name": "x",
"nodeType": "VariableDeclaration",
"src": "35:15:1",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {},
"typeName":
{
"id": 3,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "35:6:1",
"typeDescriptions": {}
},
"visibility": "internal"
}
],
"id": 6,
"initialValue":
{
"hexValue": "48656c6c6f20576f726c64",
"id": 5,
"kind": "string",
"nodeType": "Literal",
"src": "53:13:1",
"typeDescriptions": {},
"value": "Hello World"
},
"nodeType": "VariableDeclarationStatement",
"src": "35:31:1"
}
]
},
"id": 8,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "f",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "23:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "33:0:1"
},
"src": "13:56:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"src": "0:71:1"
}
],
"src": "0:72:1"
}
@@ -0,0 +1,198 @@
{
"absolutePath": "a",
"id": 23,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 5,
"name": "A",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 3,
"nodeType": "Block",
"src": "45:2:1",
"statements": []
},
"id": 4,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "f",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "27:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "45:0:1"
},
"src": "17:30:1",
"stateMutability": "nonpayable",
"virtual": true,
"visibility": "public"
}
],
"src": "0:49:1"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 10,
"name": "B",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 8,
"nodeType": "Block",
"src": "95:2:1",
"statements": []
},
"id": 9,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "f",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 6,
"nodeType": "ParameterList",
"parameters": [],
"src": "77:2:1"
},
"returnParameters":
{
"id": 7,
"nodeType": "ParameterList",
"parameters": [],
"src": "95:0:1"
},
"src": "67:30:1",
"stateMutability": "nonpayable",
"virtual": true,
"visibility": "public"
}
],
"src": "50:49:1"
},
{
"abstract": false,
"baseContracts":
[
{
"baseName":
{
"id": 11,
"name": "A",
"nodeType": "UserDefinedTypeName",
"src": "114:1:1",
"typeDescriptions": {}
},
"id": 12,
"nodeType": "InheritanceSpecifier",
"src": "114:1:1"
},
{
"baseName":
{
"id": 13,
"name": "B",
"nodeType": "UserDefinedTypeName",
"src": "117:1:1",
"typeDescriptions": {}
},
"id": 14,
"nodeType": "InheritanceSpecifier",
"src": "117:1:1"
}
],
"contractDependencies": [],
"contractKind": "contract",
"id": 22,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 20,
"nodeType": "Block",
"src": "160:2:1",
"statements": []
},
"id": 21,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "f",
"nodeType": "FunctionDefinition",
"overrides":
{
"id": 18,
"nodeType": "OverrideSpecifier",
"overrides":
[
{
"id": 16,
"name": "A",
"nodeType": "UserDefinedTypeName",
"src": "154:1:1",
"typeDescriptions": {}
},
{
"id": 17,
"name": "B",
"nodeType": "UserDefinedTypeName",
"src": "157:1:1",
"typeDescriptions": {}
}
],
"src": "145:14:1"
},
"parameters":
{
"id": 15,
"nodeType": "ParameterList",
"parameters": [],
"src": "135:2:1"
},
"returnParameters":
{
"id": 19,
"nodeType": "ParameterList",
"parameters": [],
"src": "160:0:1"
},
"src": "125:37:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"src": "100:64:1"
}
],
"src": "0:165:1"
}
@@ -0,0 +1,99 @@
{
"absolutePath": "a",
"id": 10,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 9,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"body":
{
"id": 7,
"nodeType": "Block",
"src": "33:42:1",
"statements":
[
{
"assignments":
[
4
],
"declarations":
[
{
"constant": false,
"id": 4,
"mutability": "mutable",
"name": "x",
"nodeType": "VariableDeclaration",
"src": "35:15:1",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {},
"typeName":
{
"id": 3,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "35:6:1",
"typeDescriptions": {}
},
"visibility": "internal"
}
],
"id": 6,
"initialValue":
{
"hexValue": "48656c6c6f20f09f9883",
"id": 5,
"kind": "unicodeString",
"nodeType": "Literal",
"src": "53:19:1",
"typeDescriptions": {},
"value": "Hello \ud83d\ude03"
},
"nodeType": "VariableDeclarationStatement",
"src": "35:37:1"
}
]
},
"id": 8,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "f",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 1,
"nodeType": "ParameterList",
"parameters": [],
"src": "23:2:1"
},
"returnParameters":
{
"id": 2,
"nodeType": "ParameterList",
"parameters": [],
"src": "33:0:1"
},
"src": "13:62:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"src": "0:77:1"
}
],
"src": "0:78:1"
}
@@ -0,0 +1,54 @@
{
"absolutePath": "a",
"id": 6,
"nodeType": "SourceUnit",
"nodes":
[
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"id": 1,
"name": "L",
"nodeType": "ContractDefinition",
"nodes": [],
"src": "0:12:1"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"id": 5,
"name": "C",
"nodeType": "ContractDefinition",
"nodes":
[
{
"id": 4,
"libraryName":
{
"id": 2,
"name": "L",
"nodeType": "UserDefinedTypeName",
"src": "32:1:1",
"typeDescriptions": {}
},
"nodeType": "UsingForDirective",
"src": "26:17:1",
"typeName":
{
"id": 3,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "38:4:1",
"typeDescriptions": {}
}
}
],
"src": "13:32:1"
}
],
"src": "0:46:1"
}
+44 -4
View File
@@ -73,6 +73,7 @@ ASTJSONTest::ASTJSONTest(string const& _filename)
BOOST_THROW_EXCEPTION(runtime_error("Invalid test contract file name: \"" + _filename + "\"."));
m_astFilename = _filename.substr(0, _filename.size() - 4) + ".json";
m_astParseOnlyFilename = _filename.substr(0, _filename.size() - 4) + "_parseOnly.json";
m_legacyAstFilename = _filename.substr(0, _filename.size() - 4) + "_legacy.json";
ifstream file(_filename);
@@ -112,6 +113,15 @@ ASTJSONTest::ASTJSONTest(string const& _filename)
m_expectation += line + "\n";
}
file.close();
file.open(m_astParseOnlyFilename);
if (file)
{
string line;
while (getline(file, line))
m_expectationParseOnly += line + "\n";
}
file.close();
file.open(m_legacyAstFilename);
if (file)
@@ -120,6 +130,7 @@ ASTJSONTest::ASTJSONTest(string const& _filename)
while (getline(file, line))
m_expectationLegacy += line + "\n";
}
file.close();
}
TestCase::TestResult ASTJSONTest::run(ostream& _stream, string const& _linePrefix, bool const _formatted)
@@ -136,8 +147,36 @@ TestCase::TestResult ASTJSONTest::run(ostream& _stream, string const& _linePrefi
c.setSources(sources);
c.setEVMVersion(solidity::test::CommonOptions::get().evmVersion());
if (!c.compile(CompilerStack::State::Parsed))
{
SourceReferenceFormatterHuman formatter(_stream, _formatted, false);
for (auto const& error: c.errors())
formatter.printErrorInformation(*error);
return TestResult::FatalError;
}
bool resultsMatch = runTest(
m_expectationParseOnly,
m_resultParseOnly,
sourceIndices,
c,
false,
"parseOnly",
_stream,
_linePrefix,
_formatted
);
c.reset();
c.setSources(sources);
c.setEVMVersion(solidity::test::CommonOptions::get().evmVersion());
if (!c.parse())
{
// Empty Expectations means we expect failure
if (m_expectation.empty() && m_expectationLegacy.empty())
return resultsMatch ? TestResult::Success : TestResult::Failure;
SourceReferenceFormatterHuman formatter(_stream, _formatted, false);
for (auto const& error: c.errors())
formatter.printErrorInformation(*error);
@@ -146,7 +185,7 @@ TestCase::TestResult ASTJSONTest::run(ostream& _stream, string const& _linePrefi
c.analyze();
bool resultsMatch = runTest(
resultsMatch = runTest(
m_expectation,
m_result,
sourceIndices,
@@ -156,7 +195,7 @@ TestCase::TestResult ASTJSONTest::run(ostream& _stream, string const& _linePrefi
_stream,
_linePrefix,
_formatted
);
) && resultsMatch;
resultsMatch = runTest(
m_expectationLegacy,
@@ -191,7 +230,7 @@ bool ASTJSONTest::runTest(
for (size_t i = 0; i < m_sources.size(); i++)
{
ostringstream result;
ASTJsonConverter(_legacy, _sourceIndices).print(result, _compiler.ast(m_sources[i].first));
ASTJsonConverter(_legacy, _compiler.state(), _sourceIndices).print(result, _compiler.ast(m_sources[i].first));
_result += result.str();
if (i != m_sources.size() - 1)
_result += ",";
@@ -234,7 +273,7 @@ bool ASTJSONTest::runTest(
return false;
}
return true;;
return true;
}
void ASTJSONTest::printSource(ostream& _stream, string const& _linePrefix, bool const) const
@@ -255,6 +294,7 @@ void ASTJSONTest::printUpdatedExpectations(std::ostream&, std::string const&) co
{
updateExpectation(m_astFilename, m_result, "");
updateExpectation(m_legacyAstFilename, m_resultLegacy, "legacy ");
updateExpectation(m_astParseOnlyFilename, m_resultParseOnly, "parseOnly ");
}
void ASTJSONTest::updateExpectation(string const& _filename, string const& _expectation, string const& _variation) const
+5 -3
View File
@@ -34,7 +34,6 @@ class CompilerStack;
namespace solidity::frontend::test
{
class ASTJSONTest: public TestCase
{
public:
@@ -50,9 +49,9 @@ private:
bool runTest(
std::string& _expectation,
std::string& _result,
std::map<std::string, unsigned> const& _sourceIndicies,
std::map<std::string, unsigned> const& _sourceIndices,
CompilerStack& _compiler,
bool _legacy,
bool _parseOnly,
std::string const& _variation,
std::ostream& _stream,
std::string const& _linePrefix = "",
@@ -66,10 +65,13 @@ private:
std::vector<std::pair<std::string, std::string>> m_sources;
std::string m_expectationLegacy;
std::string m_expectationParseOnly;
std::string m_astFilename;
std::string m_astParseOnlyFilename;
std::string m_legacyAstFilename;
std::string m_result;
std::string m_resultLegacy;
std::string m_resultParseOnly;
};
}
+16 -1
View File
@@ -94,7 +94,22 @@ ErrorList AnalysisFramework::filterErrors(ErrorList const& _errorList, bool _inc
continue;
}
errors.emplace_back(currentError);
std::shared_ptr<Error const> newError = currentError;
for (auto const& messagePrefix: m_messagesToCut)
if (currentError->comment()->find(messagePrefix) == 0)
{
SourceLocation const* location = boost::get_error_info<errinfo_sourceLocation>(*currentError);
// sufficient for now, but in future we might clone the error completely, including the secondary location
newError = make_shared<Error>(
currentError->errorId(),
currentError->type(),
location ? *location : SourceLocation(),
messagePrefix + " ...."
);
break;
}
errors.emplace_back(newError);
}
return errors;
+1
View File
@@ -71,6 +71,7 @@ protected:
langutil::ErrorList filterErrors(langutil::ErrorList const& _errorList, bool _includeWarnings) const;
std::vector<std::string> m_warningsToFilter = {"This is a pre-release compiler version"};
std::vector<std::string> m_messagesToCut = {"Source file requires different compiler version (current compiler is"};
/// @returns reference to lazy-instanciated CompilerStack.
solidity::frontend::CompilerStack& compiler()
+32
View File
@@ -2453,6 +2453,38 @@ BOOST_AUTO_TEST_CASE(event_indexed_string)
BOOST_CHECK_EQUAL(logTopic(0, 0), util::keccak256(string("E(string,uint256[4])")));
}
BOOST_AUTO_TEST_CASE(event_indexed_function)
{
char const* sourceCode = R"(
contract C {
event Test(function() external indexed);
function f() public {
emit Test(this.f);
}
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
callContractFunction("f()");
BOOST_REQUIRE_EQUAL(numLogs(), 1);
BOOST_CHECK_EQUAL(logAddress(0), m_contractAddress);
BOOST_CHECK(logData(0) == bytes());
BOOST_REQUIRE_EQUAL(numLogTopics(0), 2);
bytes functionHash = util::keccak256("f()").asBytes();
bytes address = m_contractAddress.asBytes();
bytes selector = bytes(functionHash.cbegin(), functionHash.cbegin() + 4);
bytes padding = bytes(8, 0);
bytes functionABI = address + selector + padding;
BOOST_CHECK_EQUAL(logTopic(0, 1).hex(), util::toHex(functionABI));
BOOST_CHECK_EQUAL(logTopic(0, 0), util::keccak256(string("Test(function)")));
)
}
BOOST_AUTO_TEST_CASE(empty_name_input_parameter_with_named_one)
{
char const* sourceCode = R"(
+4 -31
View File
@@ -121,38 +121,10 @@ BOOST_AUTO_TEST_CASE(reserved_keywords)
BOOST_CHECK(!TokenTraits::isReservedKeyword(Token::Identifier));
BOOST_CHECK(TokenTraits::isReservedKeyword(Token::After));
BOOST_CHECK(TokenTraits::isReservedKeyword(Token::Unchecked));
BOOST_CHECK(TokenTraits::isReservedKeyword(Token::Var));
BOOST_CHECK(!TokenTraits::isReservedKeyword(Token::Illegal));
}
BOOST_AUTO_TEST_CASE(unsatisfied_version)
{
char const* text = R"(
pragma solidity ^99.99.0;
)";
CHECK_PARSE_ERROR(text, "Source file requires different compiler version");
}
BOOST_AUTO_TEST_CASE(unsatisfied_version_followed_by_invalid_syntax)
{
char const* text = R"(
pragma solidity ^99.99.0;
this is surely invalid
)";
CHECK_PARSE_ERROR(text, "Source file requires different compiler version");
}
BOOST_AUTO_TEST_CASE(unsatisfied_version_with_recovery)
{
char const* text = R"(
pragma solidity ^99.99.0;
contract test {
uint ;
}
)";
Error err = getError(text, true);
BOOST_CHECK(searchErrorMessage(err, "Expected identifier but got ';'"));
}
BOOST_AUTO_TEST_CASE(function_natspec_documentation)
{
char const* text = R"(
@@ -543,10 +515,11 @@ BOOST_AUTO_TEST_CASE(keyword_is_reserved)
"switch",
"typedef",
"typeof",
"unchecked"
"unchecked",
"var"
};
BOOST_CHECK_EQUAL(std::size(keywords), static_cast<int>(Token::Unchecked) - static_cast<int>(Token::After) + 1);
BOOST_CHECK_EQUAL(std::size(keywords), static_cast<int>(Token::Var) - static_cast<int>(Token::After) + 1);
for (auto const& keyword: keywords)
{
+85
View File
@@ -1420,6 +1420,91 @@ BOOST_AUTO_TEST_CASE(standard_output_selection_wildcard_multiple_sources)
BOOST_REQUIRE(result["sources"]["B"].isObject());
}
BOOST_AUTO_TEST_CASE(stopAfter_invalid_value)
{
char const* input = R"(
{
"language": "Solidity",
"sources":
{ "": { "content": "pragma solidity >=0.0; contract C { function f() public pure {} }" } },
"settings":
{
"stopAfter": "rrr",
"outputSelection":
{
"*": { "C": ["evm.bytecode"] }
}
}
}
)";
Json::Value result = compile(input);
BOOST_CHECK(containsError(result, "JSONError", "Invalid value for \"settings.stopAfter\". Only valid value is \"parsing\"."));
}
BOOST_AUTO_TEST_CASE(stopAfter_invalid_type)
{
char const* input = R"(
{
"language": "Solidity",
"sources":
{ "": { "content": "pragma solidity >=0.0; contract C { function f() public pure {} }" } },
"settings":
{
"stopAfter": 3,
"outputSelection":
{
"*": { "C": ["evm.bytecode"] }
}
}
}
)";
Json::Value result = compile(input);
BOOST_CHECK(containsError(result, "JSONError", "\"settings.stopAfter\" must be a string."));
}
BOOST_AUTO_TEST_CASE(stopAfter_bin_conflict)
{
char const* input = R"(
{
"language": "Solidity",
"sources":
{ "": { "content": "pragma solidity >=0.0; contract C { function f() public pure {} }" } },
"settings":
{
"stopAfter": "parsing",
"outputSelection":
{
"*": { "C": ["evm.bytecode"] }
}
}
}
)";
Json::Value result = compile(input);
BOOST_CHECK(containsError(result, "JSONError", "Requested output selection conflicts with \"settings.stopAfter\"."));
}
BOOST_AUTO_TEST_CASE(stopAfter_ast_output)
{
char const* input = R"(
{
"language": "Solidity",
"sources": {
"a.sol": {
"content": "// SPDX-License-Identifier: GPL-3.0\nimport \"tes32.sol\";\n contract C is X { constructor() {} }"
}
},
"settings": {
"stopAfter": "parsing",
"outputSelection": { "*": { "": [ "ast" ] } }
}
}
)";
Json::Value result = compile(input);
BOOST_CHECK(result["sources"].isObject());
BOOST_CHECK(result["sources"]["a.sol"].isObject());
BOOST_CHECK(result["sources"]["a.sol"]["ast"].isObject());
}
BOOST_AUTO_TEST_SUITE_END()
} // end namespaces
@@ -0,0 +1,3 @@
pragma solidity ^99.99.0;
// ----
// SyntaxError 3997: (0-25): Source file requires different compiler version (current compiler is ....
@@ -0,0 +1,4 @@
pragma solidity ^99.99.0;
this is surely invalid
// ----
// ParserError 7858: (26-30): Expected pragma, import directive or contract/interface/library/struct/enum/function definition.
@@ -0,0 +1,7 @@
pragma solidity ^99.99.0;
contract C {
uint ;
}
// ----
// ParserError 6635: (48-49): Expected identifier but got ';'
// ParserError 6635: (50-51): Expected ';' but got '}'
@@ -0,0 +1,7 @@
pragma solidity ^99.99.0;
contract C {
function f() {}
}
// ----
// SyntaxError 3997: (0-25): Source file requires different compiler version (current compiler is ....
// SyntaxError 4937: (43-58): No visibility specified. Did you intend to add "public"?
+29
View File
@@ -0,0 +1,29 @@
pragma experimental ABIEncoderV2;
contract C {
function exp_neg_one(uint exponent) public returns(int) {
return (-1)**exponent;
}
function exp_two(uint exponent) public returns(uint) {
return 2**exponent;
}
function exp_zero(uint exponent) public returns(uint) {
return 0**exponent;
}
function exp_one(uint exponent) public returns(uint) {
return 1**exponent;
}
}
// ====
// optimize: false
// optimize-yul: false
// ----
// creation:
// codeDepositCost: 119800
// executionCost: 165
// totalCost: 119965
// external:
// exp_neg_one(uint256): 2259
// exp_one(uint256): infinite
// exp_two(uint256): infinite
// exp_zero(uint256): infinite
@@ -0,0 +1,29 @@
pragma experimental ABIEncoderV2;
contract C {
function exp_neg_one(uint exponent) public returns(int) {
return (-1)**exponent;
}
function exp_two(uint exponent) public returns(uint) {
return 2**exponent;
}
function exp_zero(uint exponent) public returns(uint) {
return 0**exponent;
}
function exp_one(uint exponent) public returns(uint) {
return 1**exponent;
}
}
// ====
// optimize: true
// optimize-yul: true
// ----
// creation:
// codeDepositCost: 53200
// executionCost: 105
// totalCost: 53305
// external:
// exp_neg_one(uint256): 1962
// exp_one(uint256): 1915
// exp_two(uint256): 1893
// exp_zero(uint256): 1937
@@ -0,0 +1,17 @@
contract C {
uint8 b = 23;
uint120[][] s;
uint8 a = 17;
function f() public {
s.push();
assert(s.length == 1);
assert(s[0].length == 0);
s[0].push();
assert(s[0].length == 1);
assert(s[0][0] == 0);
}
}
// ====
// compileViaYul: also
// ----
// f() ->
@@ -0,0 +1,18 @@
contract C {
uint120[] data;
function f() public returns (uint120, uint120, uint120) {
data.push(123);
data.push(234);
data.push(345);
delete data;
assembly {
sstore(data.slot, 3)
}
return (data[0], data[1], data[2]);
}
}
// ====
// compileViaYul: also
// ----
// f() -> 0, 0, 0
@@ -39,6 +39,8 @@ contract c {
}
}
// ====
// compileViaYul: also
// ----
// getLengths() -> 0, 0
// setLengths(uint256,uint256): 48, 49 ->
@@ -24,6 +24,8 @@ contract C {
array2d.push().push() = value;
}
}
// ====
// compileViaYul: also
// ----
// l() -> 0
// f(uint256,uint256): 42, 64 ->
@@ -18,6 +18,8 @@ contract C {
n[1][1].b = 10;
}
}
// ====
// compileViaYul: also
// ----
// m(uint256,uint256): 0, 0 -> 0x00, 0x00
// m(uint256,uint256): 1, 0 -> 1, 2
@@ -16,6 +16,8 @@ contract C {
n[1][1].b = 10;
}
}
// ====
// compileViaYul: also
// ----
// m(uint256,uint256): 0, 0 -> FAILURE
// m(uint256,uint256): 1, 0 -> 1, 2
@@ -0,0 +1,28 @@
contract C {
struct S {
uint256 x;
uint128 y;
uint32 z;
uint128[3] a1;
uint128[] a2;
}
uint8 b = 23;
S[] s;
uint8 a = 17;
function f() public {
s.push();
assert(s[0].x == 0);
assert(s[0].y == 0);
assert(s[0].z == 0);
assert(s[0].a1[0] == 0);
assert(s[0].a1[1] == 0);
assert(s[0].a1[2] == 0);
assert(s[0].a2.length == 0);
assert(b == 23);
assert(a == 17);
}
}
// ====
// compileViaYul: also
// ----
// f() ->
@@ -83,6 +83,5 @@ contract InternalCall {
// Warning 2018: (1144-1206): Function state mutability can be restricted to pure
// Warning 2018: (1212-1274): Function state mutability can be restricted to pure
// Warning 2018: (1280-1342): Function state mutability can be restricted to pure
// Warning 5084: (782-813): Type conversion is not yet fully supported and might yield false positives.
// Warning 4588: (771-814): Assertion checker does not yet implement this type of function call.
// Warning 5729: (1403-1408): Assertion checker does not yet implement this type of function call.
@@ -5,4 +5,3 @@ contract C {
}
}
// ----
// Warning 5084: (106-114): Type conversion is not yet fully supported and might yield false positives.
@@ -1,4 +1,4 @@
==== Source: ====
==== Source: C.sol ====
import "B.sol";
pragma experimental SMTChecker;
contract C is B {
@@ -21,5 +21,4 @@ contract B is A {
}
}
// ----
// Warning 6328: (103-117): CHC: Assertion violation happens here.
// Warning 6328: (B.sol:71-85): CHC: Assertion violation happens here.
// Warning 6328: (C.sol:103-117): CHC: Assertion violation happens here.
@@ -1,4 +1,4 @@
==== Source: ====
==== Source: C.sol ====
import "B.sol";
pragma experimental SMTChecker;
contract C is B {
@@ -23,5 +23,5 @@ contract B is A {
}
// ----
// Warning 6328: (B.sol:103-117): CHC: Assertion violation happens here.
// Warning 6328: (103-117): CHC: Assertion violation happens here.
// Warning 6328: (B.sol:103-117): CHC: Assertion violation happens here.
// Warning 6328: (C.sol:103-117): CHC: Assertion violation happens here.
@@ -1,4 +1,4 @@
==== Source: ====
==== Source: C.sol ====
import "A.sol";
pragma experimental SMTChecker;
contract C is A {
@@ -22,5 +22,5 @@ contract B is A {
}
}
// ----
// Warning 6328: (103-117): CHC: Assertion violation happens here.
// Warning 6328: (B.sol:103-117): CHC: Assertion violation happens here.
// Warning 6328: (C.sol:103-117): CHC: Assertion violation happens here.
@@ -1,6 +1,6 @@
==== Source: A.sol ====
contract A { function f() public {} }
==== Source:====
==== Source: B.sol ====
import "A.sol";
pragma experimental SMTChecker;
contract C is A {}
@@ -1,4 +1,4 @@
==== Source: ====
==== Source: B.sol ====
import "A.sol";
pragma experimental SMTChecker;
contract C is A {}
@@ -1,4 +1,4 @@
==== Source: ====
==== Source: B.sol ====
import "A.sol";
pragma experimental SMTChecker;
contract C is A {}
@@ -5,4 +5,3 @@ contract C {
}
}
// ----
// Warning 5084: (101-109): Type conversion is not yet fully supported and might yield false positives.
@@ -5,4 +5,3 @@ contract C {
}
}
// ----
// Warning 5084: (102-112): Type conversion is not yet fully supported and might yield false positives.
@@ -5,5 +5,3 @@ contract C {
}
}
// ----
// Warning 5084: (101-111): Type conversion is not yet fully supported and might yield false positives.
// Warning 5084: (115-125): Type conversion is not yet fully supported and might yield false positives.
@@ -3,10 +3,8 @@ pragma experimental SMTChecker;
contract C {
function f() public pure {
uint x = uint(~1);
// This assertion fails because type conversion is still unsupported.
assert(x == 2**256 - 2);
assert(~1 == -2);
}
}
// ----
// Warning 6328: (169-192): CHC: Assertion violation happens here.
@@ -6,6 +6,3 @@ contract test {
}
// ----
// Warning 2072: (80-88): Unused local variable.
// Warning 4984: (91-112): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 5084: (91-100): Type conversion is not yet fully supported and might yield false positives.
// Warning 5084: (103-112): Type conversion is not yet fully supported and might yield false positives.
@@ -0,0 +1,12 @@
pragma experimental SMTChecker;
contract C {
function f(bytes calldata b) external pure {
require(b[10] == 0xff);
assert(bytes(b[10:20]).length == 10);
assert(bytes(b[10:20])[0] == 0xff);
assert(bytes(b[10:20])[5] == 0xff);
}
}
// ----
// Warning 6328: (198-232): CHC: Assertion violation happens here.
@@ -0,0 +1,17 @@
pragma experimental SMTChecker;
contract C {
function f(bytes calldata b) external pure {
require(b.length == 30);
require(b[10] == 0xff);
require(b[b.length - 1] == 0xaa);
assert(bytes(b[10:]).length == 20);
assert(bytes(b[10:])[0] == 0xff);
assert(bytes(b[10:])[5] == 0xff);
assert(bytes(b[10:])[19] == 0xaa);
}
}
// ----
// Warning 4661: (221-253): BMC: Assertion violation happens here.
// Warning 4661: (257-289): BMC: Assertion violation happens here.
// Warning 4661: (293-326): BMC: Assertion violation happens here.
@@ -0,0 +1,13 @@
pragma experimental SMTChecker;
contract C {
function f(bytes calldata b) external pure {
require(b[0] == 0xff);
assert(bytes(b[:20]).length == 20);
assert(bytes(b[:20])[0] == 0xff);
assert(bytes(b[:20])[5] == 0xff);
}
}
// ----
// Warning 6328: (193-225): CHC: Assertion violation happens here.
// Warning 4661: (157-189): BMC: Assertion violation happens here.
@@ -8,6 +8,3 @@ contract C {
}
}
// ----
// Warning 2923: (94-109): Assertion checker does not yet implement this expression.
// Warning 2923: (113-128): Assertion checker does not yet implement this expression.
// Warning 2923: (132-165): Assertion checker does not yet implement this expression.
@@ -5,5 +5,4 @@ contract C {
}
}
// ----
// Warning 2923: (143-152): Assertion checker does not yet implement this expression.
// Warning 4588: (126-154): Assertion checker does not yet implement this type of function call.
@@ -7,20 +7,10 @@ contract C
uint32 b = uint16(a); // b will be 0x00001234
assert(b == 0x1234);
uint32 c = uint32(bytes4(a)); // c will be 0x12340000
// This fails because right padding is not supported.
assert(c == 0x12340000);
uint8 d = uint8(uint16(a)); // d will be 0x34
// False positive since truncating is not supported yet.
assert(d == 0x34);
uint8 e = uint8(bytes1(a)); // e will be 0x12
// False positive since truncating is not supported yet.
assert(e == 0x12);
}
}
// ----
// Warning 6328: (280-303): CHC: Assertion violation happens here.
// Warning 6328: (414-431): CHC: Assertion violation happens here.
// Warning 6328: (542-559): CHC: Assertion violation happens here.
// Warning 5084: (186-195): Type conversion is not yet fully supported and might yield false positives.
// Warning 5084: (317-333): Type conversion is not yet fully supported and might yield false positives.
// Warning 5084: (451-460): Type conversion is not yet fully supported and might yield false positives.
@@ -9,4 +9,3 @@ contract C
}
}
// ----
// Warning 5084: (94-103): Type conversion is not yet fully supported and might yield false positives.
@@ -10,4 +10,3 @@ contract C
}
}
// ----
// Warning 5084: (108-117): Type conversion is not yet fully supported and might yield false positives.
@@ -10,4 +10,3 @@ contract C
}
// ----
// Warning 6328: (149-163): CHC: Assertion violation happens here.
// Warning 5084: (108-117): Type conversion is not yet fully supported and might yield false positives.
@@ -12,6 +12,4 @@ contract C
}
}
// ----
// Warning 6328: (207-230): CHC: Assertion violation happens here.
// Warning 6328: (273-287): CHC: Assertion violation happens here.
// Warning 5084: (108-117): Type conversion is not yet fully supported and might yield false positives.
@@ -9,4 +9,3 @@ contract C
}
}
// ----
// Warning 5084: (94-102): Type conversion is not yet fully supported and might yield false positives.

Some files were not shown because too many files have changed in this diff Show More