Truffle

Quickly build, test, compile and debug using Truffle. Write scripts and plugins to automate common processes.

1. Install Truffle

Install command

$ npm install truffle -g

2. Create Project Directory

First, choose directory to place source code.

$ mkdir meverse-test
$ cd meverse-test

3. Initialize Truffle

To deploy contract, initialize Truffle.

$ truffle init

4. Write Simple Smart Contract in Solidity

Create MEVerseGreeter.sol in meverse-test/contracts directory.

Write the following code in MEVerseGreeter.sol

5. Modify Migration Script

Deploy contract with hdwallet-provider. Install the library first.

  • you can also deploy contracts written via Truffle's Dashboard, please refer to the Dashboard for more details.

Use Truffle Dashboard : https://trufflesuite.com/docs/truffle/how-to/use-the-truffle-dashboard/

Modify MEVerse Testnet network information at truffle-config.js

6. Deploy Smart Contract with Truffle

7. Check Deployment

You can check the deployment by running deployed contract method.

you can check the deployed contract's network with truffle networks command

To connect the deployed contract with network, please use the following command

create instance and check if it runs well by calling method in instance

Finally, check the Contract Address in Console and search tx hash in MEVerse Testnet Scan

Testnet Scan - view transaction with tx hash

Last updated