Skip to content

Commit

Permalink
changes for amoy with hardhat and cardona config
Browse files Browse the repository at this point in the history
  • Loading branch information
lydiagarms committed Feb 5, 2025
1 parent f82f1a1 commit 7771685
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 21 deletions.
26 changes: 15 additions & 11 deletions src/boilerplate/common/bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ rm -rf proving-files

perl -i -pe "s,docker-compose.zapp.yml -f docker-compose.zapp.override.yml,docker-compose.zapp.yml,g" package.json

if [[ $network == 'amoy' ]] || [[ $network == 'sepolia' ]] || [[ $network == 'goerli' ]]
if [[ $network == 'amoy' ]] || [[ $network == 'sepolia' ]] || [[ $network == 'goerli' ]] || [[ $network == 'cardona' ]]
then
perl -i -pe "s,DEFAULT_ACCOUNT: '',DEFAULT_ACCOUNT: \'$account\',g" docker-compose.zapp.override.yml
perl -i -pe "s,DEFAULT_ACCOUNT_MNEMONIC: '',DEFAULT_ACCOUNT_MNEMONIC: \'$mnemonic\',g" docker-compose.zapp.override.yml
Expand All @@ -56,27 +56,31 @@ fi

if [[ $network == 'amoy' ]]
then
perl -i -pe "s,RPC_URL: '',RPC_URL: \'wss:\/\/polygon-amoy.g.alchemy.com\/v2\/$rpc\',g" docker-compose.zapp.override.yml
perl -i -pe "s,development_ganache,amoy,g" deploy.sh
perl -i -pe "s,while,##while,g" deploy.sh
perl -i -pe "s,10,60,g" bin/startup
perl -i -pe "if (!\$found1 && s/RPC_URL: ''/RPC_URL: 'wss:\/\/polygon-amoy.g.alchemy.com\/v2\/$rpc'/) { \$found1 = 1 }" docker-compose.zapp.override.yml
perl -i -pe "if (!\$found2 && s/RPC_URL: ''/RPC_URL: 'https:\/\/polygon-amoy.g.alchemy.com\/v2\/$rpc'/) { \$found2 = 1 }" docker-compose.zapp.override.yml
perl -i -pe "if (!\$found3 && s/RPC_URL: ''/RPC_URL: 'wss:\/\/polygon-amoy.g.alchemy.com\/v2\/$rpc'/) { \$found3 = 1 }" docker-compose.zapp.override.yml
perl -i -pe "s,migrations/deploy.js,migrations/deploy.js --network amoy,g" deploy.sh
fi


if [[ $network == 'sepolia' ]]
then
perl -i -pe "s,RPC_URL: '',RPC_URL: \'wss://sepolia.infura.io/ws/v3//$rpc\',g" docker-compose.zapp.override.yml
perl -i -pe "s,development_ganache,sepolia,g" deploy.sh
perl -i -pe "s,while,##while,g" deploy.sh
perl -i -pe "s,10,500,g" bin/startup
perl -i -pe "s,migrations/deploy.js,migrations/deploy.js --network sepolia,g" deploy.sh
fi

if [[ $network == 'goerli' ]]
then
perl -i -pe "s,RPC_URL: '',RPC_URL: \'wss://goerli.infura.io/ws/v3/$rpc\',g" docker-compose.zapp.override.yml
perl -i -pe "s,development_ganache,goerli,g" deploy.sh
perl -i -pe "s,while,##while,g" deploy.sh
perl -i -pe "s,10,500,g" bin/startup
perl -i -pe "s,migrations/deploy.js,migrations/deploy.js --network goerli,g" deploy.sh
fi

if [[ $network == 'cardona' ]]
then
perl -i -pe "if (!\$found1 && s/RPC_URL: ''/RPC_URL: 'wss:\/\/polygon-zkevm-cardona.blastapi.io\/$rpc'/) { \$found1 = 1 }" docker-compose.zapp.override.yml
perl -i -pe "if (!\$found2 && s/RPC_URL: ''/RPC_URL: 'https:\/\/polygon-zkevm-cardona.blastapi.io\/$rpc'/) { \$found2 = 1 }" docker-compose.zapp.override.yml
perl -i -pe "if (!\$found3 && s/RPC_URL: ''/RPC_URL: 'wss:\/\/polygon-zkevm-cardona.blastapi.io\/$rpc'/) { \$found3 = 1 }" docker-compose.zapp.override.yml
perl -i -pe "s,migrations/deploy.js,migrations/deploy.js --network cardona,g" deploy.sh
fi

if [ ! -d "proving-files" ]; then
Expand Down
28 changes: 18 additions & 10 deletions src/boilerplate/common/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require('@nomicfoundation/hardhat-toolbox')
require('hardhat-contract-sizer')

const rpcUrl = process.env.RPC_URL;
const mnemonic = process.env.DEFAULT_ACCOUNT_MNEMONIC;
const accountKey = process.env.KEY;
module.exports = {
defaultNetwork: 'localhost',
networks: {
Expand All @@ -14,23 +14,31 @@ module.exports = {
timeout: 20000000
},
amoy: {
url: rpcUrl,
accounts: mnemonic,
chainId: 80002,
gas: 8500000,
gasPrice: 30000000000, // 30 Gwei
timeout: 200000,
},
url: rpcUrl,
accounts: [accountKey,],
chainId: 80002,
gas: 8500000,
gasPrice: 30000000000, // 30 Gwei
timeout: 200000,
},
cardona: {
url: rpcUrl,
accounts:[accountKey,],
chainId: 2442,
gas: 15000000,
gasPrice: 90000000000, // 30 Gwei
timeout: 200000,
},
sepolia: {
url: rpcUrl,
accounts: mnemonic,
accounts: [accountKey,],
chainId: 11155111,
gas:8500000,
timeout: 20000000
},
goerli: {
url: rpcUrl,
accounts: mnemonic,
accounts: [accountKey,],
chainId: 5,
gas: 8500000,
timeout: 20000000,
Expand Down

0 comments on commit 7771685

Please sign in to comment.