Skip to content

Commit

Permalink
➕ Add XDC Network Test and Main Network Configurations
Browse files Browse the repository at this point in the history
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
  • Loading branch information
pcaversaccio committed Oct 20, 2024
1 parent cac18b1 commit d3178d2
Show file tree
Hide file tree
Showing 7 changed files with 335 additions and 279 deletions.
2 changes: 1 addition & 1 deletion contracts/lib/forge-std
Submodule forge-std updated 2 files
+20 −0 src/Vm.sol
+1 −1 test/Vm.t.sol
2 changes: 1 addition & 1 deletion contracts/src/Greeter.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.27;
pragma solidity ^0.8.28;

contract Greeter {
string private greeting;
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/Greeter.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.27;
pragma solidity ^0.8.28;

import {Greeter} from "../src/Greeter.sol";
import {Test} from "forge-std/Test.sol";
Expand Down
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ libs = ["contracts/lib"] # Configure an array o
cache = true # Enable caching.
cache_path = "cache" # Set the path to the cache.
force = false # Do not ignore the cache.
solc_version = "0.8.27" # Set the Solidity compiler version.
solc_version = "0.8.28" # Set the Solidity compiler version.
evm_version = "paris" # Set the EVM target version.
optimizer = true # Enable the Solidity compiler optimiser.
optimizer_runs = 999_999 # Configure the number of optimiser runs.
Expand Down
35 changes: 33 additions & 2 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const config: HardhatUserConfig = {
// https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/cancun.md
// Only use Solidity default versions `>=0.8.20` for EVM networks that support the opcode `PUSH0`
// Otherwise, use the versions `<=0.8.19`
version: "0.8.27",
version: "0.8.28",
settings: {
optimizer: {
enabled: true,
Expand All @@ -87,7 +87,7 @@ const config: HardhatUserConfig = {
},
},
zksolc: {
version: "1.5.4",
version: "1.5.6",
compilerSource: "binary",
settings: {
enableEraVMExtensions: false,
Expand Down Expand Up @@ -889,6 +889,18 @@ const config: HardhatUserConfig = {
accounts,
ledgerAccounts,
},
xdcTestnet: {
chainId: 51,
url: vars.get("XDC_TESTNET_URL", "https://erpc.apothem.network"),
accounts,
ledgerAccounts,
},
xdcMain: {
chainId: 50,
url: vars.get("XDC_MAINNET_URL", "https://rpc.xinfin.network"),
accounts,
ledgerAccounts,
},
},
xdeploy: {
// Change this name to the name of your main contract
Expand Down Expand Up @@ -1115,6 +1127,9 @@ const config: HardhatUserConfig = {
plumeTestnet: vars.get("PLUME_API_KEY", ""),
// For Unichain testnet
unichainTestnet: vars.get("UNICHAIN_API_KEY", ""),
// For XDC testnet & mainnet
xdc: vars.get("XDC_API_KEY", ""),
xdcTestnet: vars.get("XDC_API_KEY", ""),
},
customChains: [
{
Expand Down Expand Up @@ -1787,6 +1802,22 @@ const config: HardhatUserConfig = {
browserURL: "https://sepolia.uniscan.xyz",
},
},
{
network: "xdc",
chainId: 50,
urls: {
apiURL: "https://bapi.blocksscan.io",
browserURL: "https://xdcscan.io",
},
},
{
network: "xdcTestnet",
chainId: 51,
urls: {
apiURL: "https://abapi.blocksscan.io",
browserURL: "https://apothem.xdcscan.io",
},
},
],
},
// tenderly: {
Expand Down
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@
"deploy:worldchainmain": "npx hardhat run --network worldChainMain scripts/deploy.ts",
"deploy:plumetestnet": "npx hardhat run --network plumeTestnet scripts/deploy.ts",
"deploy:unichaintestnet": "npx hardhat run --network unichainTestnet scripts/deploy.ts",
"deploy:xdctestnet": "npx hardhat run --network xdcTestnet scripts/deploy.ts",
"deploy:xdcmain": "npx hardhat run --network xdcMain scripts/deploy.ts",
"prettier:check": "npx prettier -c \"**/*.{js,ts,md,sol,json,yml,yaml}\"",
"prettier:fix": "npx prettier -w \"**/*.{js,ts,md,sol,json,yml,yaml}\"",
"solhint:check": "npx solhint \"contracts/**/*.sol\"",
Expand All @@ -162,7 +164,7 @@
"lint:fix": "pnpm prettier:fix && pnpm solhint:fix && npx eslint . --fix"
},
"devDependencies": {
"@eslint/js": "^9.12.0",
"@eslint/js": "^9.13.0",
"@matterlabs/hardhat-zksync-deploy": "^1.5.0",
"@matterlabs/hardhat-zksync-ethers": "1.2.1",
"@matterlabs/hardhat-zksync-solc": "^1.2.5",
Expand All @@ -176,16 +178,16 @@
"@nomicfoundation/hardhat-network-helpers": "^1.0.12",
"@nomicfoundation/hardhat-verify": "^2.0.11",
"@nomicfoundation/ignition-core": "^0.15.6",
"@openzeppelin/contracts": "^5.0.2",
"@openzeppelin/contracts": "^5.1.0",
"@tenderly/hardhat-tenderly": "^2.4.0",
"@truffle/dashboard-hardhat-plugin": "^0.2.15",
"@typechain/ethers-v6": "^0.5.1",
"@typechain/hardhat": "^9.1.0",
"@types/chai": "^4.3.20",
"@types/mocha": "^10.0.9",
"@types/node": "^22.7.5",
"@types/node": "^22.7.7",
"chai": "^4.5.0",
"eslint": "^9.12.0",
"eslint": "^9.13.0",
"eslint-config-prettier": "^9.1.0",
"ethers": "^6.13.4",
"hardhat": "^2.22.13",
Expand All @@ -199,8 +201,8 @@
"ts-node": "^10.9.2",
"typechain": "^8.3.2",
"typescript": "^5.6.3",
"typescript-eslint": "^8.9.0",
"xdeployer": "^3.1.3",
"typescript-eslint": "^8.10.0",
"xdeployer": "^3.1.4",
"zksync-ethers": "^6.14.0"
}
}
Loading

0 comments on commit d3178d2

Please sign in to comment.