update truffle config for polygon

This commit is contained in:
c9s 2021-11-20 23:08:31 +08:00
parent d14d230ea4
commit 180e7423e1
2 changed files with 24 additions and 8213 deletions

View File

@ -17,12 +17,9 @@
* phrase from a file you've .gitignored so it doesn't accidentally become public.
*
*/
// const HDWalletProvider = require('@truffle/hdwallet-provider');
// const infuraKey = "fj4jll3k.....";
//
// const fs = require('fs');
// const mnemonic = fs.readFileSync(".secret").toString().trim();
const fs = require('fs');
const HDWalletProvider = require('@truffle/hdwallet-provider');
const secret = JSON.parse(fs.readFileSync("polygon-secret.json").toString().trim());
module.exports = {
/**
@ -72,6 +69,20 @@ module.exports = {
// network_id: 2111, // This network is yours, in the cloud.
// production: true // Treats this network as if it was a public net. (default: false)
// }
polygon: {
provider: () => new HDWalletProvider(secret.privateKey, "https://polygon-rpc.com"),
network_id: 137,
confirmations: 3,
timeoutBlocks: 200,
skipDryRun: true
},
mumbai: {
provider: () => new HDWalletProvider(secret.privateKey, "https://matic-mumbai.chainstacklabs.com"),
network_id: 80001,
confirmations: 3,
timeoutBlocks: 200,
skipDryRun: true
},
},
// Set default mocha options here, use special reporters etc.
@ -82,7 +93,7 @@ module.exports = {
// Configure your compilers
compilers: {
solc: {
version: "0.6.2", // Fetch exact version from solc-bin (default: truffle's version)
version: "0.6.6", // Fetch exact version from solc-bin (default: truffle's version)
// docker: true, // Use "0.5.1" you've installed locally with docker (default: false)
// settings: { // See the solidity docs for advice about optimization and evmVersion
// optimizer: {
@ -92,5 +103,11 @@ module.exports = {
// evmVersion: "byzantium"
// }
}
},
plugins: [
'truffle-plugin-verify'
],
api_keys: {
etherscan: secret.etherScanApiKey
}
};

File diff suppressed because it is too large Load Diff