A truffle SDK for deploying smart contracts on Wanchain.
Important Notice: wanchain-truffle-sdk
is now deprecated, please switch to @truffle/hdwallet-provider
.
Wanchain is fully compatible with Ethereum after Saturn fork (v3.0.0).
Use NPM or Yarn to install the package:
npm install --save wanchain-truffle-sdk
Step 1: Modify truffle-config.js
const WanProvider = require('wanchain-truffle-sdk').WanProvider;
const wanProvider = new WanProvider("your-mnemonic-or-private-key", "wanchain-node-or-iwan-url");
module.exports = {
networks: {
......
wan: {
provider: wanProvider,
network_id: "*"
}
......
}
}
Step 2: Use truffle command to deploy contracts
truffle migrate --network wan