Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing tokens on the Erigon testnet #10

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fixed transfer size for ease of testing. Added wallets for tests and …
…ZChain testnet into the HH config
  • Loading branch information
MichaelKorchagin committed Nov 19, 2024
commit bc8d8802d4d1b7057648a9639a1259cd69e038d4
51 changes: 35 additions & 16 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -49,26 +49,45 @@ const config : HardhatUserConfig = {
timeout: 5000000,
},
networks: {
mainnet: {
url: `${process.env.MAINNET_RPC_URL}`,
gasPrice: 80000000000,
},
sepolia: {
url: `${process.env.SEPOLIA_RPC_URL}`,
timeout: 10000000,
// accounts: [ // Comment out for CI, uncomment this when using Sepolia
// `${process.env.DEPLOY_ADMIN_PRIVATE_KEY}`,
// `${process.env.TESTNET_PRIVATE_KEY_A}`,
// `${process.env.TESTNET_PRIVATE_KEY_B}`,
// `${process.env.TESTNET_PRIVATE_KEY_C}`,
// `${process.env.TESTNET_PRIVATE_KEY_D}`,
// `${process.env.TESTNET_PRIVATE_KEY_E}`,
// `${process.env.TESTNET_PRIVATE_KEY_F}`,
// ],
// mainnet: {
// url: `${process.env.MAINNET_RPC_URL}`,
// gasPrice: 80000000000,
// },
// sepolia: {
// url: `${process.env.SEPOLIA_RPC_URL}`,
// timeout: 10000000,
// // accounts: [ // Comment out for CI, uncomment this when using Sepolia
// // `${process.env.DEPLOY_ADMIN_PRIVATE_KEY}`,
// // `${process.env.TESTNET_PRIVATE_KEY_A}`,
// // `${process.env.TESTNET_PRIVATE_KEY_B}`,
// // `${process.env.TESTNET_PRIVATE_KEY_C}`,
// // `${process.env.TESTNET_PRIVATE_KEY_D}`,
// // `${process.env.TESTNET_PRIVATE_KEY_E}`,
// // `${process.env.TESTNET_PRIVATE_KEY_F}`,
// // ],
// },
zchaintest: {
url: `${process.env.ZCHAINTEST_RPC_URL}`,
chainId: 2012605151,
accounts: [
`${process.env.TESTNET_DEPLOYER}`,
`${process.env.BENEFICIARY_KEY}`,
`${process.env.USER_KEY}`,
],
},
},
etherscan: {
apiKey: `${process.env.ETHERSCAN_API_KEY}`,
customChains: [
{
network: "zchaintest",
chainId: 2012605151,
urls: {
apiURL: "https://wilderworld-dev-erigon1-blockscout.eu-north-2.gateway.fm/api/",
browserURL: "https://wilderworld-dev-erigon1-blockscout.eu-north-2.gateway.fm/",
},
},
],
},
};

3 changes: 2 additions & 1 deletion test/ZToken.testChain.test.ts
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
import { expect } from "chai";
import { ethers } from "hardhat";
import { ZToken } from "../typechain";
import { parseEther } from "ethers";

describe("ZToken Campaign Tests", async () => {
let zToken : ZToken;
@@ -29,7 +30,7 @@ describe("ZToken Campaign Tests", async () => {

it("Should allow transferring tokens", async () => {
const balanceBefore = await zToken.connect(ownerSigner).balanceOf(ownerSigner.address);
const transferAmount = 2n;
const transferAmount = parseEther("20");

const tx = await zToken.connect(beneficiarySigner).transfer(ownerSigner.address, transferAmount);
// wait 2 blocks just in case (can fail with 1)
2 changes: 1 addition & 1 deletion test/mongo-global.ts
Original file line number Diff line number Diff line change
@@ -8,6 +8,6 @@ export const mochaGlobalSetup = async () => {
export const mochaGlobalTeardown = async () => {
const mongoAdapter = await getZTokenMongoAdapter();
// the next line can be commented out to leave the DB after test to manually test
await mongoAdapter.dropDB();
// await mongoAdapter.dropDB();
await mongoAdapter.close();
};