- Start Here
- Networks
- Access Control List (ACL)
- Accounts (Addresses)
- Simulator
- Audits
- Unpack
- Abstract Syntax Tree (AST)
- Get Contract ASTGET
- Get Contract ConstantsGET
- Get Contract ConstructorsGET
- Get Contract DefinitionsGET
- Get Contract DocumentationGET
- Get Contract EnumsGET
- Get Contract ErrorsGET
- Get Contract EventsGET
- Get Contract FunctionsGET
- Get Contract ImportsGET
- Get Contract InterfacesGET
- Get Contract LibrariesGET
- Get Contract LicenseGET
- Get Contract State VariablesGET
- Get Contract StatisticsGET
- Get Contract StructsGET
- Control Flow Graphs (CFG)
- Constructors
- Contracts
- Metadata
- Tokens
- Variables
- Functions
- Events
- Standards
- Statistics
Get Contract AST
GET
https://api.unpack.dev/v1/ast/{networkId}/{address}
Abstract Syntax Tree (AST)
Last modified:2024-05-31 11:02:21
Request
Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.Example:
Authorization: Bearer ********************
Path Params
networkId
integer <int64>
required
Default:
1
Example:
1
address
string
required
>= 42 characters<= 42 characters
Example:
0x5dbad78818d4c8958eff2d5b95b28385a22113cd
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://api.unpack.dev/v1/ast/1/0x5dbad78818d4c8958eff2d5b95b28385a22113cd'
Responses
🟢200OK
application/json
Body
$schema
string <uri>
read-onlyoptional
Example:
https://api.unpack.dev/schemas/Ast.json
ast
object (RootNode)
required
comments
array[object (Comment) {4}]
required
entrySourceUnit
integer <int64>
required
globals
array
required
id
integer <int64>
required
nodeType
integer <int32>
required
root
array[object (SourceUnitNodeSourceUnit) {10}]
required
contractAddress
string
required
contractId
string
required
networkId
object (Int)
required
Example
{
"$schema": "https://api.unpack.dev/schemas/Ast.json",
"ast": {
"comments": [
{
"id": 0,
"nodeType": 0,
"src": {
"column": 0,
"end": 0,
"length": 0,
"line": 0,
"parentIndex": 0,
"start": 0
},
"text": "string"
}
],
"entrySourceUnit": 0,
"globals": [
null
],
"id": 0,
"nodeType": 0,
"root": [
{
"absolutePath": "string",
"baseContracts": [
{
"baseName": {
"contractReferencedDeclaration": 0,
"id": 0,
"name": "string",
"nodeType": 0,
"referencedDeclaration": 0,
"src": {
"column": 0,
"end": 0,
"length": 0,
"line": 0,
"parentIndex": 0,
"start": 0
}
},
"id": 0,
"nodeType": 0,
"src": {
"column": 0,
"end": 0,
"length": 0,
"line": 0,
"parentIndex": 0,
"start": 0
}
}
],
"exportedSymbols": [
{
"absolute_path": "string",
"id": 0,
"name": "string"
}
],
"id": 0,
"kind": 0,
"license": "string",
"name": "string",
"nodeType": 0,
"nodes": [
null
],
"src": {
"column": 0,
"end": 0,
"length": 0,
"line": 0,
"parentIndex": 0,
"start": 0
}
}
]
},
"contractAddress": "string",
"contractId": "string",
"networkId": {}
}
🔴500Error
Modified at 2024-05-31 11:02:21