Skip to content

Commit

Permalink
add bnb mainnet deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-H-Leonard committed Jan 12, 2025
1 parent 74eeb33 commit dd3fdde
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 29 deletions.
4 changes: 0 additions & 4 deletions smart-contract/deploy/deploy-charge-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ async function main() {
await hre.run("verify:verify", {
address: deployedAddress,
});

// Need to wait to avoid rate limit
await sleep(2000);
await addContractToAdmin(deployedAddress, "Charge Handler");
}

// We recommend this pattern to be able to use async/await everywhere
Expand Down
12 changes: 6 additions & 6 deletions smart-contract/deploy/deploy-gatewaytoken.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { sleep, getDeploymentSigner } from "./defender-utils";
import hre , { ethers, upgrades } from "hardhat";
import { Signer } from '@ethersproject/abstract-signer/src.ts'
import { BNB_TESTNET_CONTRACT_ADDRESSES, COMPLERE_TESTNET_CONTRACT_ADDRESSES } from "./utils";
import { BNB_MAINNET_CONTRACT_ADDRESSES } from "./utils";

async function main() {
const signer: Signer = await getDeploymentSigner();

const gatewayNetworkContractAddress = COMPLERE_TESTNET_CONTRACT_ADDRESSES.gatewayNetwork;
const gatekeeperContractAddress = COMPLERE_TESTNET_CONTRACT_ADDRESSES.gatekeeper;
const gatewayStakingContractAddress = COMPLERE_TESTNET_CONTRACT_ADDRESSES.gatewayStaking;
const chargeHandlerContractAddress = COMPLERE_TESTNET_CONTRACT_ADDRESSES.chargeHandler;
const flagsStorageContractAddress = COMPLERE_TESTNET_CONTRACT_ADDRESSES.flagsStorage;
const gatewayNetworkContractAddress = BNB_MAINNET_CONTRACT_ADDRESSES.gatewayNetwork;
const gatekeeperContractAddress = BNB_MAINNET_CONTRACT_ADDRESSES.gatekeeper;
const gatewayStakingContractAddress = BNB_MAINNET_CONTRACT_ADDRESSES.gatewayStaking;
const chargeHandlerContractAddress = BNB_MAINNET_CONTRACT_ADDRESSES.chargeHandler;
const flagsStorageContractAddress = BNB_MAINNET_CONTRACT_ADDRESSES.flagsStorage;
const superAdmin = process.env.BSC_TESTNET_RELAYER!;
const name = "Gateway Token";
const symbol = "GWTK";
Expand Down
2 changes: 0 additions & 2 deletions smart-contract/deploy/gatekeeper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ async function main() {
await verify(deployedAddress,[]);

// Need to wait to avoid rate limit
await sleep(2000);
await addContractToAdmin(deployedAddress, "Gatekeeper");
}


Expand Down
4 changes: 0 additions & 4 deletions smart-contract/deploy/gatewayTokenForwarder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ async function main() {
await sleep(6000);

await verify(deployedAddress,[forwardedSignatureExpirationInBlocks]);

// Need to wait to avoid rate limit
await sleep(2000);
await addContractToAdmin(deployedAddress, "FlexibleNonceForwarder");
}


Expand Down
9 changes: 3 additions & 6 deletions smart-contract/deploy/gatewaynetwork.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { addContractToAdmin, sleep, verify, getDeploymentSigner } from "./defender-utils";
import { Signer } from '@ethersproject/abstract-signer/src.ts'
import { ethers, upgrades } from 'hardhat';
import { BNB_TESTNET_CONTRACT_ADDRESSES, COMPLERE_TESTNET_CONTRACT_ADDRESSES } from "./utils";
import { BNB_MAINNET_CONTRACT_ADDRESSES } from "./utils";


async function main() {
const testnetGatekeeperContractAddress = COMPLERE_TESTNET_CONTRACT_ADDRESSES.gatekeeper;
const testnetStakingContractAddress = COMPLERE_TESTNET_CONTRACT_ADDRESSES.gatewayStaking;
const testnetGatekeeperContractAddress = BNB_MAINNET_CONTRACT_ADDRESSES.gatekeeper;
const testnetStakingContractAddress = BNB_MAINNET_CONTRACT_ADDRESSES.gatewayStaking;

const signer: Signer = await getDeploymentSigner();
const signerAddress = await signer.getAddress();
Expand All @@ -26,9 +26,6 @@ async function main() {

await verify(deployedAddress,[]);

// Need to wait to avoid rate limit
await sleep(2000);
await addContractToAdmin(deployedAddress, "GatewayNetwork");
}

// We recommend this pattern to be able to use async/await everywhere
Expand Down
7 changes: 2 additions & 5 deletions smart-contract/deploy/gatewaystaking.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { addContractToAdmin, getDeploymentSigner, sleep, verify } from "./defender-utils";
import { ethers , upgrades } from 'hardhat';
import { Signer } from '@ethersproject/abstract-signer/src.ts'
import { BNB_TESTNET_CONTRACT_ADDRESSES, COMPLERE_TESTNET_CONTRACT_ADDRESSES } from "./utils";
import { BNB_MAINNET_CONTRACT_ADDRESSES } from "./utils";

async function main() {
const testnetTokenContractAddress = COMPLERE_TESTNET_CONTRACT_ADDRESSES.erc20;
const testnetTokenContractAddress = BNB_MAINNET_CONTRACT_ADDRESSES.erc20;

const args = [testnetTokenContractAddress , 'Identity Test Staking Vault', "ID_TEST_STAKE"];

Expand All @@ -29,9 +29,6 @@ async function main() {

await verify(deployedAddress,args);

// Need to wait to avoid rate limit
await sleep(2000);
await addContractToAdmin(deployedAddress, "GatewayStaking");
}


Expand Down
12 changes: 12 additions & 0 deletions smart-contract/deploy/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ interface GatewayProtocolContractAddresses {
trustedForwarder: string
}

export const BNB_MAINNET_CONTRACT_ADDRESSES: GatewayProtocolContractAddresses = {
flagsStorage: "0xa42353DeEda212dD62Fd76357AaBBD377867E3de",
gatekeeper: "0x3B17Cc23547fa956678792d4Db7d1a460ED1BE6C",
gatewayNetwork: "0x9A76a53CF4B75174D89a4b88797164677d363e0e",
chargeHandler: "0x1B40fC7f6731860e48dEd4781E765998fA58e507",
gatewayStaking: "0x2Ee110078Be3848fC3Da52c373c1B0c7C6486ea8",
erc20: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", // USDC on BNB (https://bscscan.com/address/0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d)
gatewayToken: "0x62160b81c9872283d63de561d7469D440560a7cb",
forwarder: "0xD3d93548af709b3d717C160B82816f4351290878",
trustedForwarder: "0xD3d93548af709b3d717C160B82816f4351290878"
}

export const BNB_TESTNET_CONTRACT_ADDRESSES: GatewayProtocolContractAddresses = {
flagsStorage: "0x06c9d91b3Acc1D2434342242C987064E555FFe8a",
gatekeeper: "0x47340b5b62a1c9038aa70dc1e7344be5a59da8af",
Expand Down
10 changes: 8 additions & 2 deletions smart-contract/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ module.exports = {
url: `${process.env.BNB_TESTNET_RPC_URL}`,
accounts: liveAccounts,
chainId: 5918836757,
}
},
bnbMainnet: {
url: `${process.env.BNB_TESTNET_RPC_URL}`,
accounts: liveAccounts,
chainId: 56,
},
},
solidity: {
version: '0.8.19',
Expand Down Expand Up @@ -127,7 +132,8 @@ module.exports = {
polygonZkEVMTestnet: process.env.POLYGONSCAN_API_KEY,
arbitrumOne: process.env.ARBISCAN_API_KEY,
arbitrumGoerli: process.env.ARBISCAN_API_KEY,
bscTestnet: process.env.BSC_SCAN_API_KEY
bscTestnet: process.env.BSC_SCAN_API_KEY,
bsc: process.env.BSC_SCAN_API_KEY
},
customChains: [
{
Expand Down

0 comments on commit dd3fdde

Please sign in to comment.