Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support contract ABIs #34

Closed
tkstanczak opened this issue Jan 29, 2022 · 0 comments
Closed

Support contract ABIs #34

tkstanczak opened this issue Jan 29, 2022 · 0 comments
Labels
Core Features or changes related to core package

Comments

@tkstanczak
Copy link
Member

CONTRACT ABI
Contract ABI is a representation of a StarkNet contract. It is formatted as a JSON and describes the functions and the structs of the contracts.

You can get it via –

starknet-compile contract.cairo
--output contract_compiled.json
--abi contract_abi.json
or by executing get_code in the StarkNet CLI.

EXAMPLE ABI
[
{
"members": [
{
"name": "x",
"offset": 0,
"type": "felt"
},
{
"name": "y",
"offset": 1,
"type": "felt"
}
],
"name": "Point",
"size": 2,
"type": "struct"
},
{
"inputs": [
{
"name": "a_len",
"type": "felt"
},
{
"name": "a",
"type": "felt*"
}
],
"name": "constructor",
"outputs": [],
"type": "constructor"
},
{
"inputs": [
{
"name": "a_len",
"type": "felt"
},
{
"name": "a",
"type": "felt*"
},
{
"name": "b_len",
"type": "felt"
},
{
"name": "b",
"type": "felt*"
}
],
"name": "input_arrays",
"outputs": [],
"type": "function"
},
{
"inputs": [
{
"name": "array_len",
"type": "felt"
},
{
"name": "array",
"type": "felt*"
}
],
"name": "output_arrays",
"outputs": [
{
"name": "array_len",
"type": "felt"
},
{
"name": "array",
"type": "felt*"
}
],
"type": "function"
},
{
"inputs": [
{
"name": "points",
"type": "(Point, Point)"
}
],
"name": "input_output_struct",
"outputs": [
{
"name": "res",
"type": "Point"
}
],
"type": "function"
}
]

@tkstanczak tkstanczak added Core Features or changes related to core package abi labels Jan 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Features or changes related to core package
Projects
None yet
Development

No branches or pull requests

2 participants