Icon SunFilledIcon MoonStars
ABI Typegen

Icon LinkABI Typegen

Icon LinkThe JSON ABI file

Whether you want to deploy or connect to a pre-existing smart contract, the JSON ABI file is what makes it possible.

It tells the SDK about the ABI methods in your Smart Contracts and Scripts

Given the following Sway smart contract:

abi MyContract {
    fn test_function() -> bool;
impl MyContract for Contract {
    fn test_function() -> bool {

The JSON ABI file would look something like this:

$ cat out/debug/my-test-abi.json
    "type": "function",
    "inputs": [],
    "name": "test_function",
    "outputs": [
        "name": "",
        "type": "bool",
        "components": null

See also: