Truffle
Deploying Smart Contract Using Truffle
Preparation
Project Setting
npm init -ynpm install --save-dev truffle// Some codenpx truffle initnpm init -ynpm install --save-dev truffle// Some codenpx truffle init// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract MyContract {
// Write the smart contract code.
}const MyContract = artifacts.require("MyContract");
module.exports = function(deployer) {
deployer.deploy(MyContract);
};npx truffle migrate --network <network-name>