// SPDX-License-Identifier: MITpragma solidity ^0.5.6;contract Mortal {/* Define Variable owner of the type address */ address payable owner;/* This function is executed at initialization and sets the owner of the contract */constructor () public { owner =msg.sender; }/* Function to recover the funds on the contract */functionkill() publicpayable { if (msg.sender == owner) selfdestruct(owner); }}contract MEVerseGreeter is Mortal {/* Define variable greeting of the type string */ string greeting;/* This runs when the contract is executed */constructor (string memory _greeting) public { greeting = _greeting; }/* Main function */functiongreet() publicviewreturns (string memory) {return greeting; }}
Modify Migration Script
Deploy contract with hdwallet-provider. Install the library first.
$npminstall@truffle/hdwallet-provider
you can also deploy contracts written via Truffle's Dashboard, please refer to the Dashboard for more details.