Skip to content

Commit

Permalink
Add new Civic Global pass
Browse files Browse the repository at this point in the history
  • Loading branch information
dankelleher committed Aug 29, 2024
1 parent cc30f25 commit 1a3fa58
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ethereum/smart-contract/deploy/base-gatekeeper-network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { getAccounts } from '../scripts/util';
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers';
import { Contract } from 'ethers';
import {BigNumber, Contract} from 'ethers';

/**
* Deploy the base set of gatekeeper networks.
Expand All @@ -17,6 +17,7 @@ const networks = {
b1gz9sD7TeH6cagodm4zTcAx6LkZ56Etisvgr6jGFQb: 7,
uniqobk8oGh4XBLMqM68K8M2zNu3CdYX7q5go7whQiv: 10,
vaa1QRNEBb1G2XjPohqGWnPsvxWnwwXF67pdjrhDSwM: 11,
cidNdd9GGhpgUJRTrto1A1ayN2PKAuaW7pg1rqj6bRD: BigInt("0x09266570c8755cb9e9d8ea3d75c5251514f0eb45c6f2a86d39ace69e516988ec"),
},
dev: {
tigoYhp9SpCDoCQmXGj2im5xa3mnjR1zuXrpCJ5ZRmi: 14,
Expand All @@ -32,13 +33,14 @@ const addToNetwork = async (
deployer: SignerWithAddress,
gatekeeper: string,
contract: Contract,
slotId: number,
slotId: number | bigint,
) => {
console.log('Creating NETWORK: ' + networkName + ' with slotId: ' + slotId + ' and gatekeeper: ' + gatekeeper);
if (await contract.getNetwork(slotId)) {
console.log('network ' + slotId + ' already exists');
} else {
const createNetworkTx = await (await contract.createNetwork(slotId, networkName, false, NULL_ADDRESS)).wait();
const tx = await contract.createNetwork(BigNumber.from(slotId), networkName, false, NULL_ADDRESS);
const createNetworkTxReceipt = await tx.wait();
console.log(
'created network ' +
networkName +
Expand All @@ -47,7 +49,7 @@ const addToNetwork = async (
') on Gateway Token at ' +
contract.address +
' using ' +
createNetworkTx.gasUsed.toNumber() +
createNetworkTxReceipt.gasUsed.toNumber() +
' gas',
);
}
Expand Down
3 changes: 3 additions & 0 deletions ethereum/smart-contract/scripts/decToHex.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const decimal = BigInt(process.argv[2]);
const hex = decimal.toString(16).padStart(64, '0');
console.log(hex);

0 comments on commit 1a3fa58

Please sign in to comment.