Deploy Contracts
Explains how to deploy contract using the SDK.
Last updated
Explains how to deploy contract using the SDK.
Last updated
Deployment process is quite similar to executing the contract function explained in the previous chapter.
It consists of the three steps:
Create deployment request
Redirect the user to the link generated for this concrete deployment request
Wait for the user to complete the action and receive the deployed contract instance
Before creating the deployment request, you must decide on the type of the contract you'd like to deploy. All the supported contract types are listed on the Dev3 Dashboard, so make sure you've created your first project before moving on.
In the example above, it is shown how to find the list of the deployable contracts. We then selected one item from the list, of type ERC20 Mintable, and found its contract ID (highlighted at the end of the video): openzeppelin.erc20presetmintableburnabledummy
Now that you've found the contract ID, and obtained the SDK instance object (as explained in the initialization section), run the following steps to get the contract deployed:
Two things to note here:
Constructor parameters array used for initializing the contract is built the same way as when calling the functions on the smart contract. You can see the different possibilities here. You can see the list of the constructor parameters you have to provide in the same screen where you found the contract ID for the contract you wish to deploy. In the video above, for example, after we've opened the 'Create' screen for the token we want to deploy, we can see that there are two constructor parameters we have to provide: Token Name and the Token Symbol, just below the contract alias field. These two values we have to provide when building the deployment action.
Options object provided when building the deployment action can contain the following:
All the fields are optional and can all be skipped by passing an empty object as the configuration. However, if you wish to use some (or all) of these, more detail is given in the options section.