Skip to main content

Get A Custom Contract

Connect to a deployed smart contract to start interacting with it.

Usage

# Just pass in the address of your contract and your ready
custom = sdk.get_contract(<CUSTOM_CONTRACT_ADDRESS>)

Configuration

address (required)

The address of the smart contract you want to connect to.

Must be a string.

Import Smart Contracts

If your smart contract was not deployed using thirdweb, youll need to import it on the dashboard.

Using Contract ABI

Optionally, (if you dont want to use the import feature), you can provide your smart contracts ABI to the second parameter of the get_contract method. Useful when developing on a local node, where it may be faster to use the ABI than to import the contract using the dashboard.

The ABI is only necessary if you have not deployed your contract with, or imported your contract to the thirdweb dashboard.

abi = ... # Add or import your contract abi
contract = sdk.get_contract_from_abi(<CUSTOM_CONTRACT_ADDRESS>, abi)