run truffle compile
All files that end with .sol
in /contracts
are turned into .json
files in /build/contracts
.
Solidity
alone is a .sol
file. You will need to find out how you will put your .sol
file on ETH network. Problems occurs
when you want to test run. Where to test? How about unit test? Truffle
is your rescue.
npm install -g truffle
javascript files that help deploy contracts to Ethereum network.
artifacts.require()
is similar to import
of javascripts or require
of nodes.
var ContractOne = artifacts.require("ContractOne");
var ContractTwo = artifacts.require("ContractTwo");
truffle
requires you to have contracts/Migrations.sol
contract, so that you can use migration feature of truffle
.deployer
our hero object in doing migrationsaccounts
args are to take from web3.eth.getAccounts()
. If you dont have any wallet connect like Ganache or metamask then you won't see this.{overwrite: false}
as your last parameter.