Skip to content

Commit

Permalink
Merge branch 'develop' into feature/coti-chain
Browse files Browse the repository at this point in the history
  • Loading branch information
dankelleher committed Jun 18, 2024
2 parents fbc2593 + 9fb59e3 commit a485d21
Show file tree
Hide file tree
Showing 18 changed files with 322 additions and 471 deletions.
587 changes: 198 additions & 389 deletions ethereum/gatekeeper-cli/README.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions ethereum/gatekeeper-cli/src/utils/oclif/providers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import assert = require('assert');
describe('Check ethers provider', function () {
let provider: BaseProvider
const mainnetNetworkID = 1
const goerliNetworkID = 5
const sepoliaNetworkID = 11155111;

it('Try connect to mainnet ethers provider, check network ID', async () => {
provider = getProvider('ethereum')
Expand All @@ -14,11 +14,11 @@ describe('Check ethers provider', function () {
assert.equal(networkId, mainnetNetworkID)
})

it('Try connect to goerli ethers provider, check network ID', async () => {
provider = getProvider('goerli')
it('Try connect to sepolia ethers provider, check network ID', async () => {
provider = getProvider('sepolia')
const networkId = (await provider.getNetwork()).chainId

assert.equal(networkId, goerliNetworkID)
assert.equal(networkId, sepoliaNetworkID)
})

it('Try connect to localhost provider, check connection URL', () => {
Expand Down
18 changes: 3 additions & 15 deletions ethereum/gatekeeper-cli/src/utils/oclif/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ export const networks = {
url: 'https://sepolia.infura.io/v3/',
chainId: 11_155_111,
},
goerli: {
url: 'https://goerli.infura.io/v3/',
chainId: 5,
},
polygonMumbai: {
url: 'https://polygon-mumbai.infura.io/v3/',
chainId: 80_001,
},
polygonAmoy: {
url: 'https://polygon-amoy.infura.io/v3/',
chainId: 80_002,
Expand All @@ -45,9 +37,9 @@ export const networks = {
url: 'https://aurora-mainnet.infura.io/v3/',
chainId: 1_313_161_554,
},
optimismGoerli: {
url: 'https://optimism-goerli.infura.io/v3/',
chainId: 420,
optimismSepolia: {
url: 'https://optimism-sepolia.infura.io/v3/',
chainId: 11155420,
},
optimism: {
url: 'https://optimism-mainnet.infura.io/v3/',
Expand All @@ -61,10 +53,6 @@ export const networks = {
url: 'https://palm-mainnet.infura.io/v3/',
chainId: 11_297_108_109,
},
arbitrumGoerli: {
url: 'https://arbitrum-goerli.infura.io/v3/',
chainId: 421_613,
},
arbitrumSepolia: {
url: 'https://sepolia-rollup.arbitrum.io/rpc',
chainId: 421_614,
Expand Down
37 changes: 0 additions & 37 deletions ethereum/smart-contract/config/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,6 @@ export const networks = {
accounts: liveAccounts,
chainId: 11155111,
},
goerli: {
url: process.env.GOERLI_RPC ??`https://goerli.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: liveAccounts,
chainId: 5,
},
polygonMumbai: {
url: process.env.POLYGONMUMBAI_RPC ??`https://polygon-mumbai.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: liveAccounts,
chainId: 80001,
},
polygonMainnet: {
url: process.env.POLYGON_RPC ?? `https://polygon-mainnet.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: liveAccounts,
Expand All @@ -65,13 +55,6 @@ export const networks = {
accounts: liveAccounts,
chainId: 1313161554,
},
optimismGoerli: {
url: process.env.OPGOERLI_RPC ??`https://optimism-goerli.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: liveAccounts,
chainId: 420,
// optimism goerli deployment is only reliable if a gas price is set - the gas oracles are not reliable
gasPrice: 1_000_000_000,
},
optimismSepolia: {
url: process.env.OPSEPOLIA_RPC ??`https://sepolia.optimism.io`,
accounts: liveAccounts,
Expand All @@ -94,11 +77,6 @@ export const networks = {
accounts: liveAccounts,
chainId: 11297108109,
},
arbitrumGoerli: {
url: process.env.ARBGOERLI_RPC ??`https://arbitrum-goerli.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: liveAccounts,
chainId: 421613,
},
arbitrumSepolia: {
url: process.env.ARBSEPOLIA_RPC ??`https://sepolia-rollup.arbitrum.io/rpc`,
accounts: liveAccounts,
Expand Down Expand Up @@ -134,11 +112,6 @@ export const networks = {
accounts: liveAccounts,
chainId: 0, // not documented anywhere
},
starknetGoerli: {
url: process.env.STARKNETGOERLI_RPC ??`https://starknet-goerli.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: liveAccounts,
chainId: 0, // not documented anywhere
},
xdc: {
url: process.env.XDC_RPC ??'https://erpc.xinfin.network',
accounts: liveAccounts,
Expand Down Expand Up @@ -197,11 +170,6 @@ export const networks = {
accounts: liveAccounts,
chainId: 59144,
},
lineaGoerli: {
url: process.env.LINEAGOERLI_RPC ?? `https://linea-goerli.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: liveAccounts,
chainId: 59140,
},
gnosis: {
url: process.env.GNOSIS_RPC ?? 'https://rpc.gnosischain.com',
accounts: liveAccounts,
Expand All @@ -228,11 +196,6 @@ export const networks = {
accounts: liveAccounts,
chainId: 324,
},
zkSyncGoerli: {
url: process.env.ZKSYNCGOERLI_RPC ?? 'https://testnet.era.zksync.dev',
accounts: liveAccounts,
chainId: 280,
},
oasisSapphireTestnet: {
url: 'https://testnet.sapphire.oasis.dev',
accounts: liveAccounts,
Expand Down
2 changes: 0 additions & 2 deletions ethereum/smart-contract/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,10 @@ module.exports = {
etherscan: {
apiKey: {
mainnet: process.env.ETHERSCAN_API_KEY,
goerli: process.env.ETHERSCAN_API_KEY,
polygon: process.env.POLYGONSCAN_API_KEY,
polygonZkEVM: process.env.POLYGONSCAN_API_KEY,
polygonZkEVMTestnet: process.env.POLYGONSCAN_API_KEY,
arbitrumOne: process.env.ARBISCAN_API_KEY,
arbitrumGoerli: process.env.ARBISCAN_API_KEY,
polygonAmoy: process.env.OKLINK_AMOY_API_KEY
},
customChains: [
Expand Down
2 changes: 1 addition & 1 deletion ethereum/smart-contract/scripts/gatekeeperBatch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ action=$2 # Assign the second argument to action
# mainnets
networks=(mainnet polygonMainnet arbitrumMainnet xdc polygonZkEVM fantom)
# testnets
#networks=(sepolia goerli polygonMumbai arbitrumGoerli xdcApothem polygonZkEVMTestnet fantomTestnet)
#networks=(sepolia xdcApothem polygonZkEVMTestnet fantomTestnet)
gatekeepernetworks=(1 12 13 14 15 16 17 18 20 21 23 25)

# Load completed tasks from batch.temp
Expand Down
40 changes: 38 additions & 2 deletions solana/gatekeeper-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $ npm install -g @identity.com/solana-gatekeeper-cli
$ gateway COMMAND
running command...
$ gateway (-v|--version|version)
@identity.com/solana-gatekeeper-cli/0.0.2 darwin-arm64 node-v18.16.0
@identity.com/solana-gatekeeper-cli/0.0.2 darwin-x64 node-v20.12.0
$ gateway --help [COMMAND]
USAGE
$ gateway COMMAND
Expand Down Expand Up @@ -66,6 +66,8 @@ OPTIONS
SOLANA_CLUSTER. To override this property with a specific
endpoint url, set SOLANA_CLUSTER_URL
-f, --priorityFeeLamports=priorityFeeLamports [default: 0] The priority fee in lamports
-g, --gatekeeperKey=gatekeeperKey [default: [object Object]] The private key file for the
gatekeeper authority
Expand All @@ -74,6 +76,8 @@ OPTIONS
-n, --gatekeeperNetworkKey=gatekeeperNetworkKey [default: [object Object]] The private key file for the
gatekeeper authority
--skipPreflight Skip preflight check
EXAMPLE
$ gateway add-gatekeeper tgky5YfBseCvqehzsycwCG6rh2udA4w14MxZMnZz9Hp
```
Expand All @@ -97,6 +101,8 @@ OPTIONS
SOLANA_CLUSTER. To override this property with a specific
endpoint url, set SOLANA_CLUSTER_URL
-f, --priorityFeeLamports=priorityFeeLamports [default: 0] The priority fee in lamports
-g, --gatekeeperKey=gatekeeperKey [default: [object Object]] The private key file for the
gatekeeper authority
Expand All @@ -105,9 +111,11 @@ OPTIONS
-n, --gatekeeperNetworkKey=gatekeeperNetworkKey [default: [object Object]] The public key (in base 58) of
the gatekeeper network that the gatekeeper belongs to.
--skipPreflight Skip preflight check
EXAMPLE
$ gateway burn EzZgkwaDrgycsiyGeCVRXXRcieE1fxhGMp829qwj5TMv
Revoked
Burned
```

## `gateway freeze GATEWAYTOKEN`
Expand All @@ -129,6 +137,8 @@ OPTIONS
SOLANA_CLUSTER. To override this property with a specific
endpoint url, set SOLANA_CLUSTER_URL
-f, --priorityFeeLamports=priorityFeeLamports [default: 0] The priority fee in lamports
-g, --gatekeeperKey=gatekeeperKey [default: [object Object]] The private key file for the
gatekeeper authority
Expand All @@ -137,6 +147,8 @@ OPTIONS
-n, --gatekeeperNetworkKey=gatekeeperNetworkKey [default: [object Object]] The public key (in base 58) of
the gatekeeper network that the gatekeeper belongs to.
--skipPreflight Skip preflight check
EXAMPLE
$ gateway freeze EzZgkwaDrgycsiyGeCVRXXRcieE1fxhGMp829qwj5TMv
Frozen
Expand Down Expand Up @@ -181,6 +193,8 @@ OPTIONS
-e, --expiry=expiry The expiry time in seconds for the gateway token (default
none)
-f, --priorityFeeLamports=priorityFeeLamports [default: 0] The priority fee in lamports
-g, --gatekeeperKey=gatekeeperKey [default: [object Object]] The private key file for the
gatekeeper authority
Expand All @@ -189,6 +203,8 @@ OPTIONS
-n, --gatekeeperNetworkKey=gatekeeperNetworkKey [default: [object Object]] The public key (in base 58) of
the gatekeeper network that the gatekeeper belongs to.
--skipPreflight Skip preflight check
EXAMPLE
$ gateway issue EzZgkwaDrgycsiyGeCVRXXRcieE1fxhGMp829qwj5TMv2QJjjrzdPSrcZUuAH2KrEU61crWz49KnSLSzwjDUnLSV
```
Expand All @@ -212,13 +228,17 @@ OPTIONS
SOLANA_CLUSTER. To override this property with a specific
endpoint url, set SOLANA_CLUSTER_URL
-f, --priorityFeeLamports=priorityFeeLamports [default: 0] The priority fee in lamports
-h, --help Show CLI help.
-n, --gatekeeperNetworkKey=gatekeeperNetworkKey [default: [object Object]] The private key file for the
gatekeeper authority
-o, --featureOperation=add|remove|get [default: get] add, remove, or get a network feature
--skipPreflight Skip preflight check
EXAMPLE
$ gateway network-feature userTokenExpiry
```
Expand Down Expand Up @@ -381,6 +401,8 @@ OPTIONS
SOLANA_CLUSTER. To override this property with a specific
endpoint url, set SOLANA_CLUSTER_URL
-f, --priorityFeeLamports=priorityFeeLamports [default: 0] The priority fee in lamports
-g, --gatekeeperKey=gatekeeperKey [default: [object Object]] The private key file for the
gatekeeper authority
Expand All @@ -389,6 +411,8 @@ OPTIONS
-n, --gatekeeperNetworkKey=gatekeeperNetworkKey [default: [object Object]] The public key (in base 58) of
the gatekeeper network that the gatekeeper belongs to.
--skipPreflight Skip preflight check
EXAMPLE
$ gateway refresh EzZgkwaDrgycsiyGeCVRXXRcieE1fxhGMp829qwj5TMv 54000
Refreshed
Expand All @@ -413,6 +437,8 @@ OPTIONS
SOLANA_CLUSTER. To override this property with a specific
endpoint url, set SOLANA_CLUSTER_URL
-f, --priorityFeeLamports=priorityFeeLamports [default: 0] The priority fee in lamports
-g, --gatekeeperKey=gatekeeperKey [default: [object Object]] The private key file for the
gatekeeper authority
Expand All @@ -421,6 +447,8 @@ OPTIONS
-n, --gatekeeperNetworkKey=gatekeeperNetworkKey [default: [object Object]] The public key (in base 58) of
the gatekeeper network that the gatekeeper belongs to.
--skipPreflight Skip preflight check
EXAMPLE
$ gateway revoke EzZgkwaDrgycsiyGeCVRXXRcieE1fxhGMp829qwj5TMv
Revoked
Expand All @@ -445,6 +473,8 @@ OPTIONS
SOLANA_CLUSTER. To override this property with a specific
endpoint url, set SOLANA_CLUSTER_URL
-f, --priorityFeeLamports=priorityFeeLamports [default: 0] The priority fee in lamports
-g, --gatekeeperKey=gatekeeperKey [default: [object Object]] The private key file for the
gatekeeper authority
Expand All @@ -453,6 +483,8 @@ OPTIONS
-n, --gatekeeperNetworkKey=gatekeeperNetworkKey [default: [object Object]] The private key file for the
gatekeeper authority
--skipPreflight Skip preflight check
EXAMPLE
$ gateway revoke-gatekeeper tgky5YfBseCvqehzsycwCG6rh2udA4w14MxZMnZz9Hp
```
Expand All @@ -476,6 +508,8 @@ OPTIONS
SOLANA_CLUSTER. To override this property with a specific
endpoint url, set SOLANA_CLUSTER_URL
-f, --priorityFeeLamports=priorityFeeLamports [default: 0] The priority fee in lamports
-g, --gatekeeperKey=gatekeeperKey [default: [object Object]] The private key file for the
gatekeeper authority
Expand All @@ -484,6 +518,8 @@ OPTIONS
-n, --gatekeeperNetworkKey=gatekeeperNetworkKey [default: [object Object]] The public key (in base 58) of
the gatekeeper network that the gatekeeper belongs to.
--skipPreflight Skip preflight check
EXAMPLE
$ gateway unfreeze EzZgkwaDrgycsiyGeCVRXXRcieE1fxhGMp829qwj5TMv
Unfrozen
Expand Down
8 changes: 6 additions & 2 deletions solana/gatekeeper-cli/src/commands/add-gatekeeper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {
clusterFlag,
gatekeeperKeyFlag,
gatekeeperNetworkKeyFlag,
prioFeeFlag,
skipPreflightFlag,
} from "../util/flags";
import { getConnectionFromEnv } from "../util/utils";

Expand All @@ -24,6 +26,8 @@ export default class AddGatekeeper extends Command {
gatekeeperNetworkKey: gatekeeperNetworkKeyFlag(),
cluster: clusterFlag(),
airdrop: airdropFlag,
priorityFeeLamports: prioFeeFlag(),
skipPreflight: skipPreflightFlag,
};

static args = [
Expand Down Expand Up @@ -60,8 +64,8 @@ export default class AddGatekeeper extends Command {
gatekeeperNetwork
);
const gatekeeperAccount = await networkService
.addGatekeeper(gatekeeper)
.then((t) => t.send())
.addGatekeeper(gatekeeper, flags.priorityFeeLamports ? { priorityFeeMicroLamports: flags.priorityFeeLamports } : undefined)
.then((t) => t.send(flags.skipPreflight ? {skipPreflight: true}: {}))
.then((t) => t.confirm());
this.log(
`Added gatekeeper to network. Gatekeeper account: ${
Expand Down
6 changes: 5 additions & 1 deletion solana/gatekeeper-cli/src/commands/burn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {
clusterFlag,
gatekeeperKeyFlag,
gatekeeperNetworkPubkeyFlag,
prioFeeFlag,
skipPreflightFlag,
} from "../util/flags";
import { getTokenUpdateProperties } from "../util/utils";

Expand All @@ -23,6 +25,8 @@ Burned
gatekeeperNetworkKey: gatekeeperNetworkPubkeyFlag(),
cluster: clusterFlag(),
airdrop: airdropFlag,
priorityFeeLamports: prioFeeFlag(),
skipPreflight: skipPreflightFlag,
};

static args = [
Expand All @@ -47,7 +51,7 @@ Burned

await service
.burn(gatewayToken)
.then((t) => t.send())
.then((t) => t.send(flags.skipPreflight ? {skipPreflight: true}: {}))
.then((t) => t.confirm());

this.log("Burned");
Expand Down
Loading

0 comments on commit a485d21

Please sign in to comment.