Contracts

Create contract object.

Changed on

Add a new contract to your project in Openfort

post/v1/contracts

Request

  • Base URL: https://api.openfort.io
  • URL: https://api.openfort.io/v1/contracts
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer

Request body

namestring required

Specifies the name of the contract (Only for display purposes).

chainIdinteger required

Specifies the chain ID of the contract. Must be a supported chain.

addressstring required

Specifies the address of the contract.

publicVerificationboolean

Specifies whether to verify the contract publicly.

Example request

{
  "name": "NFT Contract",
  "chainId": 80002,
  "address": "0x742e6e61d760164d56f44801054bcf40fa821d97",
  "abi": [
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "_owner",
          "type": "address"
        }
      ],
      "stateMutability": "nonpayable",
      "type": "constructor"
    },
    {
      "inputs": [],
      "name": "owner",
      "outputs": [
        {
          "internalType": "address",
          "name": "",
          "type": "address"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    }
  ]
}

Response

Successful response.

idstring required
object'contract' required
createdAtinteger required
namestring nullable required
chainIdinteger required

The chain ID.

addressstring required
deletedboolean required
publicVerificationboolean required

Changes