simplify migrate script
This commit is contained in:
2
.env
2
.env
@@ -1,4 +1,4 @@
|
|||||||
RPC_NODE_URI=http://127.0.0.1:8545
|
RPC_NODE_URI=http://127.0.0.1:8545
|
||||||
RESET_SNAPSHOT_ID=0x2
|
RESET_SNAPSHOT_ID=0x2
|
||||||
NETWORK_ID=5777
|
NETWORK_ID=5777
|
||||||
GAS_PRICE=1
|
GAS_PRICE=1
|
||||||
@@ -1,27 +1,11 @@
|
|||||||
const DecimalMath = artifacts.require("DecimalMath");
|
|
||||||
const SafeERC20 = artifacts.require("SafeERC20");
|
|
||||||
const DODOMath = artifacts.require("DODOMath");
|
|
||||||
const DODO = artifacts.require("DODO");
|
|
||||||
const DODOZoo = artifacts.require("DODOZoo");
|
const DODOZoo = artifacts.require("DODOZoo");
|
||||||
|
|
||||||
module.exports = async (deployer, network) => {
|
module.exports = async (deployer, network) => {
|
||||||
const deployDODO = async () => {
|
const deployDODOZoo = async () => {
|
||||||
await deployer.deploy(DecimalMath);
|
|
||||||
await deployer.deploy(SafeERC20);
|
|
||||||
await deployer.deploy(DODOMath);
|
|
||||||
|
|
||||||
await deployer.link(SafeERC20, DODO);
|
|
||||||
await deployer.link(DecimalMath, DODO);
|
|
||||||
await deployer.link(DODOMath, DODO);
|
|
||||||
|
|
||||||
await deployer.deploy(DODO);
|
|
||||||
await deployer.deploy(DODOZoo);
|
await deployer.deploy(DODOZoo);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (network == "production") {
|
if (network == "development") {
|
||||||
} else if (network == "kovan") {
|
await deployDODOZoo();
|
||||||
} else {
|
|
||||||
// for development & test
|
|
||||||
await deployDODO();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
"web3-eth-contract": "^1.2.8"
|
"web3-eth-contract": "^1.2.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@truffle/hdwallet-provider": "^1.0.36",
|
||||||
"ganache-cli": "^6.9.1",
|
"ganache-cli": "^6.9.1",
|
||||||
"prettier": "^2.0.5",
|
"prettier": "^2.0.5",
|
||||||
"prettier-plugin-solidity": "^1.0.0-alpha.52",
|
"prettier-plugin-solidity": "^1.0.0-alpha.52",
|
||||||
|
|||||||
@@ -58,31 +58,6 @@ module.exports = {
|
|||||||
gas: 0xfffffffffff,
|
gas: 0xfffffffffff,
|
||||||
gasPrice: 1,
|
gasPrice: 1,
|
||||||
},
|
},
|
||||||
// Another network with more advanced options...
|
|
||||||
// advanced: {
|
|
||||||
// port: 8777, // Custom port
|
|
||||||
// network_id: 1342, // Custom network
|
|
||||||
// gas: 8500000, // Gas sent with each transaction (default: ~6700000)
|
|
||||||
// gasPrice: 20000000000, // 20 gwei (in wei) (default: 100 gwei)
|
|
||||||
// from: <address>, // Account to send txs from (default: accounts[0])
|
|
||||||
// websockets: true // Enable EventEmitter interface for web3 (default: false)
|
|
||||||
// },
|
|
||||||
// Useful for deploying to a public network.
|
|
||||||
// NB: It's important to wrap the provider as a function.
|
|
||||||
// ropsten: {
|
|
||||||
// provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/v3/YOUR-PROJECT-ID`),
|
|
||||||
// network_id: 3, // Ropsten's id
|
|
||||||
// gas: 5500000, // Ropsten has a lower block limit than mainnet
|
|
||||||
// confirmations: 2, // # of confs to wait between deployments. (default: 0)
|
|
||||||
// timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
|
|
||||||
// skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
|
|
||||||
// },
|
|
||||||
// Useful for private networks
|
|
||||||
// private: {
|
|
||||||
// provider: () => new HDWalletProvider(mnemonic, `https://network.io`),
|
|
||||||
// network_id: 2111, // This network is yours, in the cloud.
|
|
||||||
// production: true // Treats this network as if it was a public net. (default: false)
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// Set default mocha options here, use special reporters etc.
|
// Set default mocha options here, use special reporters etc.
|
||||||
|
|||||||
Reference in New Issue
Block a user