Deploy a smart contract
The next step in our fixed-supply crowdsale SCUI flow is to actually deploy the contracts to the Ethereum Network.
Creating the real ERC20 token contract
Since we are deploying the actual contract, the SCUI is not simulating the deploy transaction to estimate the gas price. The SCUI will show the user the real thing.

The previous step (estimateTxCosts()) includes the next action to be taken by the user: deployToken()
This action triggers the next action (deployToken()), which readies the token to be deployed to the current network (mainnet or ropsten):
Let's have a closer look to the let receipt = await this.deployer.deployToken() method, it should be self-explanatory:
Web3 deploy
The following deployer method was developed following the web3 deploy method documentation as well as for the signTransaction and sendSignedTransaction methods.

Creating the fixed-supply crowdsale contract

The pattern for deploying the fixed-supply crowdsale contract is the same:
Set the current step (
this.steps.deployToken) as completeSet the next step (
this.steps.deployCrowdsale) as currentInitiate the contract deployment (
this.deployer.deployCrowdsale())Wait for the transaction to finish or handle errors
Trigger the next step

Transfer the ERC20 token supply to the crowdsale
This operation needs to be made after both the token contract and the crowdsale contract are deployed to the Ethereum network. You cannot transfer the token supply to the crowdsale if there's no crowdsale yet, right?
This transaction is cheap and shouldn't take long.


Last but not least, the finish button should take the user to the next route contract/0x00123<crowdsale-address>/show/fixed-supply
Last updated