Smart Contracts

Smart contracts are electronic agreements stored on distributed computers called blockchains. Use the smart contracts API to get details about contracts on the network.

Show contract details

POST /v1

Shows the details of a given smart contract on the network.

curl -v -X POST 'https://share-ddn.formless.xyz/v1' \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $API_KEY" \
-d '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "contracts_get_by_id",
    "params": {
        "contract_id": "a4680ff6-715b-4101-8ff4-5a34f32ee3f9"
    }
}'

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Body

NameTypeDescription

contract_id

string

The ID of the contract within the Formless Network.

Response

{
    "jsonrpc": "2.0",
    "id": "1",
    "result": {
        "success": true,
        "contract_address": "0xD7130CF117C9BF9D2F335A360AA67D85B9D46089",
        "network_id": 137
    }
}

A contract_address is the location of a smart contract program on a given blockchain. It is similar to a memory address on a single computer, but in this case it is the address within the context of a distributed system. Each blockchain has a globally unique ID called a network_id.

Network IDBlockchain NameDescription
1

Ethereum

Layer 1 Ethereum blockchain.

10

Optimism

Layer 2 Ethereum blockchain with faster, cheaper transactions.

137

Polygon Proof-of-Stake

Ethereum side chain with faster, cheaper transactions.

Last updated