English Article · Software · Study

Basic checklist for smart contract deployment

Let’s say we have a simple smart contract MemoryToken, it can be even a stub which has only 1 field name.

pragma solidity ^0.5.0;

contract MemoryToken {
    string public name = "Memory token";
}

1.Then to deploy it to blockchain we should use the next command:

truffle migrate --reset

The command not only do deployment, but compile the contract as well.

2. The next step is open the truffle console via:

truffle console

3. Now we have the truffle development and can use the NodeJS syntax, let’s get the token:

token = await MemoryToken.deployed()

Press the Enter button, and type: token.

4. It’s expand lots of information, then check the address via:

token.address

5. For one more step let’s check the contract name:

name = await token.name()

and enter the name, you should see the ‘Memory token‘ output.

After all of this steps we can guarantee that everything works properly and can extend the smart contract with more useful implementation.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.