Adding Contracts

After you've logged into the dashboard, you can add new smart contracts to your project.

Follow these steps to add a contract:

  1. Navigate to the top right corner of the dashboard and click on the "Add Contract" button.

  2. In the form that appears, fill out the necessary information about your deployed contract:

    • Contract Name: Enter a name for your contract. This is for your reference and can be anything that helps you identify the contract in your dashboard.

    • Contract Address: Input the address where your contract has been deployed on the blockchain.

    • ABI (Application Binary Interface): Here, you'll need to provide the ABI of your contract. The ABI is a JSON representation of your contract's methods and events that allows the SDK to understand how to interact with your contract.

If you don't have your contract's ABI, follow these steps to generate it:

Generating ABI

After you have written your smart contract, compile it using the Solidity compiler (solc). Here is a command line example:

bashCopy codesolc --abi YourContract.sol -o build

This will output a .json file in the build directory. The ABI will be contained in that file.

You can also use online IDEs like Remix. In Remix, compile your contract and click on ABI in the compilation details. This will copy the ABI to your clipboard.

After obtaining the ABI, paste it into the ABI field in the form.

Function Types

After you've successfully added the contract, SolaceConnect SDK can understand the different functions available in your contract. It does this by parsing the ABI you provided.

The SolaceConnect SDK makes it easier to interact with these functions by providing you with methods to create transaction requests and signing permissions. Refer to the requestSigningPermission method in the SDK to see how to interact with these contract functions.

Last updated