diff --git a/README.md b/README.md index bba1d75..c1dcd8d 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,20 @@ - Solidity - ^0.8.0 (solc-js) - @OpenZeppelin/contracts@4.3.0 - @truffle/hdwallet-provider + +### Truffle deployment + +A .env file with following entries is needed for Truffle deployment: + +MNEMONIC= # Mnemonic phrase for local Ganache testing +MNEMONIC_DEVNET= # Mnemonic phrase for Devnet +MNEMONIC_TESTNET= # Mnemonic phrase for Testnet +APP_ID= # Infura API key +POLYGONSCAN_API_KEY= # Polygonscan API key +CUSTODIANS_DEVNET= # Comma separated list of initial 10 custodians +CUSTODIANS_TESTNET= # Comma separated list of initial 10 custodians +# Local testing only +CUSTODIANS_LOCAL= # Comma separated list of initial 10 custodians +ORACLE= # Oracle public key used by reg-oracle.js +# Optional if deploying to Goerli Testnet +ETHERSCAN_API_KEY= diff --git a/migrations/2_nft_migration.js b/migrations/2_nft_migration.js index 3fb5477..93998e7 100644 --- a/migrations/2_nft_migration.js +++ b/migrations/2_nft_migration.js @@ -10,7 +10,7 @@ module.exports = async function (deployer, network) { await deployer.deploy(FIONFT, custodiansLocal); } else if (network == "mumbai_devnet") { await deployer.deploy(FIONFT, custodiansDevnet); - } else if (network == "mumbai_testnet") { + } else if (network == "mumbai_testnet" | network == "goerli_testnet") { await deployer.deploy(FIONFT, custodiansTestnet); } }; diff --git a/truffle-config.js b/truffle-config.js index 4fdaab3..2fb55e9 100644 --- a/truffle-config.js +++ b/truffle-config.js @@ -4,7 +4,8 @@ require('dotenv').config(); const mnemonicDevnet = process.env["MNEMONIC_DEVNET"]; const mnemonicTestnet = process.env["MNEMONIC_TESTNET"]; const appid = process.env["APP_ID"]; -const apikey = process.env["POLYGONSCAN_API_KEY"]; +const apikeyPoloygonscan = process.env["POLYGONSCAN_API_KEY"]; +const apikeyEtherscan = process.env["ETHERSCAN_API_KEY"]; module.exports = { @@ -38,9 +39,15 @@ module.exports = { network_id: 80001, confirmations: 2, timeoutBlocks: 50, - skipDryRun: true, - chainId: 80001 - } + }, + goerli_testnet: { + provider: () => new HDWalletProvider(mnemonicTestnet, 'https://goerli.infura.io/v3/' + appid), + network_id: 5, + gas: 9000000, + confirmations: 2, // # of confs to wait between deployments. (default: 0) + timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50) + skipDryRun: false // Skip dry run before migrations? (default: false for public nets ) + }, }, // Set default mocha options here, use special reporters etc. @@ -67,9 +74,10 @@ module.exports = { enabled: true }, - // Used to automatically verifiy the contract on etherscan + // Used to automatically verifiy the contract api_keys: { - polygonscan: apikey, + polygonscan: apikeyPoloygonscan, + //etherscan: apikeyEtherscan, }, plugins: [ 'truffle-plugin-verify'