ethers-rs/ethers-solc/test-data/ast/userDefinedValueType.json

356 lines
9.3 KiB
JSON

{
"absolutePath": "a",
"exportedSymbols":
{
"C":
[
27
],
"MyAddress":
[
2
],
"MyUInt":
[
4
],
"f":
[
16
]
},
"id": 28,
"nodeType": "SourceUnit",
"nodes":
[
{
"canonicalName": "MyAddress",
"id": 2,
"name": "MyAddress",
"nameLocation": "5:9:1",
"nodeType": "UserDefinedValueTypeDefinition",
"src": "0:26:1",
"underlyingType":
{
"id": 1,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "18:7:1",
"stateMutability": "nonpayable",
"typeDescriptions":
{
"typeIdentifier": "t_address",
"typeString": "address"
}
}
},
{
"canonicalName": "MyUInt",
"id": 4,
"name": "MyUInt",
"nameLocation": "32:6:1",
"nodeType": "UserDefinedValueTypeDefinition",
"src": "27:20:1",
"underlyingType":
{
"id": 3,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "42:4:1",
"typeDescriptions":
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"body":
{
"id": 15,
"nodeType": "Block",
"src": "61:34:1",
"statements":
[
{
"assignments":
[
9
],
"declarations":
[
{
"constant": false,
"id": 9,
"mutability": "mutable",
"name": "a",
"nameLocation": "77:1:1",
"nodeType": "VariableDeclaration",
"scope": 15,
"src": "67:11:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions":
{
"typeIdentifier": "t_userDefinedValueType$_MyAddress_$2",
"typeString": "MyAddress"
},
"typeName":
{
"id": 8,
"nodeType": "UserDefinedTypeName",
"pathNode":
{
"id": 7,
"name": "MyAddress",
"nameLocations":
[
"67:9:1"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 2,
"src": "67:9:1"
},
"referencedDeclaration": 2,
"src": "67:9:1",
"typeDescriptions":
{
"typeIdentifier": "t_userDefinedValueType$_MyAddress_$2",
"typeString": "MyAddress"
}
},
"visibility": "internal"
}
],
"id": 10,
"nodeType": "VariableDeclarationStatement",
"src": "67:11:1"
},
{
"assignments":
[
13
],
"declarations":
[
{
"constant": false,
"id": 13,
"mutability": "mutable",
"name": "b",
"nameLocation": "91:1:1",
"nodeType": "VariableDeclaration",
"scope": 15,
"src": "84:8:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions":
{
"typeIdentifier": "t_userDefinedValueType$_MyUInt_$4",
"typeString": "MyUInt"
},
"typeName":
{
"id": 12,
"nodeType": "UserDefinedTypeName",
"pathNode":
{
"id": 11,
"name": "MyUInt",
"nameLocations":
[
"84:6:1"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 4,
"src": "84:6:1"
},
"referencedDeclaration": 4,
"src": "84:6:1",
"typeDescriptions":
{
"typeIdentifier": "t_userDefinedValueType$_MyUInt_$4",
"typeString": "MyUInt"
}
},
"visibility": "internal"
}
],
"id": 14,
"nodeType": "VariableDeclarationStatement",
"src": "84:8:1"
}
]
},
"id": 16,
"implemented": true,
"kind": "freeFunction",
"modifiers": [],
"name": "f",
"nameLocation": "57:1:1",
"nodeType": "FunctionDefinition",
"parameters":
{
"id": 5,
"nodeType": "ParameterList",
"parameters": [],
"src": "58:2:1"
},
"returnParameters":
{
"id": 6,
"nodeType": "ParameterList",
"parameters": [],
"src": "61:0:1"
},
"scope": 28,
"src": "48:47:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"abstract": false,
"baseContracts": [],
"canonicalName": "C",
"contractDependencies": [],
"contractKind": "contract",
"fullyImplemented": true,
"id": 27,
"linearizedBaseContracts":
[
27
],
"name": "C",
"nameLocation": "105:1:1",
"nodeType": "ContractDefinition",
"nodes":
[
{
"canonicalName": "C.MyAddress",
"id": 18,
"name": "MyAddress",
"nameLocation": "118:9:1",
"nodeType": "UserDefinedValueTypeDefinition",
"src": "113:26:1",
"underlyingType":
{
"id": 17,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "131:7:1",
"stateMutability": "nonpayable",
"typeDescriptions":
{
"typeIdentifier": "t_address",
"typeString": "address"
}
}
},
{
"canonicalName": "C.MyUInt",
"id": 20,
"name": "MyUInt",
"nameLocation": "149:6:1",
"nodeType": "UserDefinedValueTypeDefinition",
"src": "144:20:1",
"underlyingType":
{
"id": 19,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "159:4:1",
"typeDescriptions":
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"constant": false,
"functionSelector": "97682884",
"id": 26,
"mutability": "mutable",
"name": "m",
"nameLocation": "205:1:1",
"nodeType": "VariableDeclaration",
"scope": 27,
"src": "169:37:1",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions":
{
"typeIdentifier": "t_mapping$_t_userDefinedValueType$_MyAddress_$18_$_t_userDefinedValueType$_MyUInt_$20_$",
"typeString": "mapping(C.MyAddress => C.MyUInt)"
},
"typeName":
{
"id": 25,
"keyType":
{
"id": 22,
"nodeType": "UserDefinedTypeName",
"pathNode":
{
"id": 21,
"name": "MyAddress",
"nameLocations":
[
"177:9:1"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 18,
"src": "177:9:1"
},
"referencedDeclaration": 18,
"src": "177:9:1",
"typeDescriptions":
{
"typeIdentifier": "t_userDefinedValueType$_MyAddress_$18",
"typeString": "C.MyAddress"
}
},
"nodeType": "Mapping",
"src": "169:28:1",
"typeDescriptions":
{
"typeIdentifier": "t_mapping$_t_userDefinedValueType$_MyAddress_$18_$_t_userDefinedValueType$_MyUInt_$20_$",
"typeString": "mapping(C.MyAddress => C.MyUInt)"
},
"valueType":
{
"id": 24,
"nodeType": "UserDefinedTypeName",
"pathNode":
{
"id": 23,
"name": "MyUInt",
"nameLocations":
[
"190:6:1"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 20,
"src": "190:6:1"
},
"referencedDeclaration": 20,
"src": "190:6:1",
"typeDescriptions":
{
"typeIdentifier": "t_userDefinedValueType$_MyUInt_$20",
"typeString": "C.MyUInt"
}
}
},
"visibility": "public"
}
],
"scope": 28,
"src": "96:113:1",
"usedErrors": []
}
],
"src": "0:210:1"
}