Truffle(2)

134 阅读1分钟
  1. contracts目录新建MyContract.sol

pragma solidity ^0.4.23;

contract MyContract {

  function mulAtoB(uint a,uint b) pure returns (uint){
        return a * b;
      }
}

  1. migractions目录新建2_initial_migration.js

var MyContract = artifacts.require("./MyContract.sol");

module.exports = function(deployer) {
  deployer.deploy(MyContract);
};

  1. deploy后