Add a smart-contract

Upload a smart contract source-code

MultiBaas currently supports Ethereum smart contracts written in the Solidity programming language, although support for additional blockchain types and smart contract programming languages may be added in the future.

A Solidity smart contract consists of one or more files which are compiled from textual source code into Ethereum Virtual Machine (EVM) bytecode and application binary interface (ABI). The ABI is metadata which describes the functions (methods) and events of the smart contract, including the input and output parameter types of each. The canonical Solidity compiler is solc.

Prepare a smart-contract for upload

Due to the compilation process, it is currently required to combine your contracts into a single file before uploading. For example, suppose you have the following two dependent contracts:

ERC20.sol

Copy
Copied
pragma solidity ^0.5.16;

contract ERC20 is Ownable {
    //Contract contents...
}

Ownable.sol

Copy
Copied
pragma solidity ^0.5.16;

contract Ownable {
    //Contract contents...
}

The two contracts must be combined together in one syntactically correct solidity file:

MyToken.sol

Copy
Copied
pragma solidity ^0.5.16;

contract ERC20 is Ownable {
    //Contract contents...
}

contract Ownable {
    //Contract contents...
}

They will be compiled using solc 0.5.16. During the contract upload process you will be able to select which of the contracts contained in the file should be saved in MultiBaas.

Uploading a smart contract

To upload a smart contract:

  1. Select Contracts from the main menu
  2. Click New Contract from the side menu
  3. Click Select Files from the Upload Smart Contracts window
  4. Open the prepared solidity file from the file selection dialogue

MultiBaas compiles the smart contract client-side and provides feedback as to what sub-contracts are present in the source code.

MultiBaas suggests labels and versions for each of the sub-contracts in the file. The suggested label is based on the name of the contract and the version is based on the number of times a contract of that name has been uploaded.

  1. Select the sub-contracts to import into MultiBaas
  2. Review or update the label and version of each of the selected sub-contracts you wish to upload
  3. Click Submit to upload the selected contracts

Note that at this time the smart contract source code, bytecode, ABI and other metadata have been persisted to the MultiBaas database. The ABI is the primary source of information about the smart contract, and is generated by the Solidity compiler, solc.

After submitting a contract you will be prompted to a deploy it to the network or link it to an existing address.

Upload a smart contract ABI

Coming soon...

Copyright © Curvegrid 2022. All right reserved.