From cb80ca73042bb863074ecd62dd9f46015946f2e0 Mon Sep 17 00:00:00 2001 From: JexxaJ <44744647+JexxaJ@users.noreply.github.com> Date: Mon, 6 Nov 2023 15:06:09 +0800 Subject: [PATCH 1/7] pulsechain networks added --- packages/networks/src/networks/index.ts | 34 +++++++------ packages/networks/src/networks/pulsechain.ts | 49 +++++++++++++++++++ .../src/networks/pulsechainTestnetV4.ts | 48 ++++++++++++++++++ 3 files changed, 115 insertions(+), 16 deletions(-) create mode 100644 packages/networks/src/networks/pulsechain.ts create mode 100644 packages/networks/src/networks/pulsechainTestnetV4.ts diff --git a/packages/networks/src/networks/index.ts b/packages/networks/src/networks/index.ts index 41d37c9b040..d1612c42785 100644 --- a/packages/networks/src/networks/index.ts +++ b/packages/networks/src/networks/index.ts @@ -1,16 +1,18 @@ -export * from './localhost' -export * from './mainnet' -export * from './gnosis' -export * from './polygon' -export * from './bsc' -export * from './optimism' -export * from './mumbai' -export * from './goerli' -export * from './celo' -export * from './arbitrum' -export * from './avalanche' -export * from './palm' -export * from './base-goerli' -export * from './base' -export * from './linea' -export * from './sepolia' +export * from './localhost' +export * from './mainnet' +export * from './gnosis' +export * from './polygon' +export * from './bsc' +export * from './optimism' +export * from './mumbai' +export * from './goerli' +export * from './celo' +export * from './arbitrum' +export * from './avalanche' +export * from './palm' +export * from './base-goerli' +export * from './base' +export * from './linea' +export * from './sepolia' +export * from './pulsechain' +export * from './pulsechainTestnetV4' diff --git a/packages/networks/src/networks/pulsechain.ts b/packages/networks/src/networks/pulsechain.ts new file mode 100644 index 00000000000..ff6675e5fcf --- /dev/null +++ b/packages/networks/src/networks/pulsechain.ts @@ -0,0 +1,49 @@ +import { NetworkConfig } from '@unlock-protocol/types' + +export const pulsechain: NetworkConfig = { + chain: 'pulsechain', + description: 'pulsechain mainnet.', + explorer: { + name: 'Pulsechain', + urls: { + address: (address: string) => + `https://scan.pulsechain.com/address/${address}`, + base: `https://scan.pulsechain.com/`, + token: (address: string, holder: string) => + `https://scan.pulsechain.com/token/${address}?a=${holder}`, + transaction: (hash: string) => `https://scan.pulsechain.com/tx/${hash}`, + }, + }, + featured: true, + fullySubsidizedGas: false, + id: 369, + isTestNetwork: false, + keyManagerAddress: '', + maxFreeClaimCost: 10000, + multisig: '', + name: 'pulsechain', + nativeCurrency: { + coingecko: 'pulsechain', + decimals: 18, + name: 'PLS', + symbol: 'PLS', + }, + previousDeploys: [], + provider: 'https://rpc.unlock-protocol.com/369', + publicLockVersionToDeploy: 13, + publicProvider: 'https://scan.pulsechain.com', + startBlock: 2247300, + // Graph can be found at https://graph.pulsechain.com/ + subgraph: { + endpoint: + '', + endpointV2: + '', + networkName: 'pulsechain', + studioEndpoint: 'unlock-protocol-pulsechain', + }, + unlockAddress: '', + url: '', +} + +export default pulsechain diff --git a/packages/networks/src/networks/pulsechainTestnetV4.ts b/packages/networks/src/networks/pulsechainTestnetV4.ts new file mode 100644 index 00000000000..d3f249db9b4 --- /dev/null +++ b/packages/networks/src/networks/pulsechainTestnetV4.ts @@ -0,0 +1,48 @@ +import { NetworkConfig } from '@unlock-protocol/types' + +export const pulsechainTestnetV4: NetworkConfig = { + chain: 'pulsechainTestnetV4', + description: 'Pulsechain Testnet V4.', + explorer: { + name: 'pulsechainTestnetV4', + urls: { + address: (address: string) => + `https://scan.v4.testnet.pulsechain.com/address/${address}`, + base: `https://scan.v4.testnet.pulsechain.com/`, + token: (address: string, holder: string) => + `https://scan.v4.testnet.pulsechain.com/token/${address}?a=${holder}`, + transaction: (hash: string) => `https://scan.v4.testnet.pulsechain.com/tx/${hash}`, + }, + }, + featured: false, + fullySubsidizedGas: false, + id: 943, + isTestNetwork: false, + keyManagerAddress: '', + maxFreeClaimCost: 10000, + multisig: '', + name: 'pulsechainTestnetV4', + nativeCurrency: { + decimals: 18, + name: 'tPLS', + symbol: 'tPLS', + }, + previousDeploys: [], + provider: 'https://rpc.unlock-protocol.com/369', + publicLockVersionToDeploy: 13, + publicProvider: 'https://scan.v4.testnet.pulsechain.com', + startBlock: 2247300, + // Graph can be found at https://scan.v4.testnet.pulsechain.com/graphiql/ + subgraph: { + endpoint: + '', + endpointV2: + '', + networkName: 'pulsechainTestnetV4', + studioEndpoint: 'unlock-protocol-pulsechainTestnetV4', + }, + unlockAddress: '', + url: '', +} + +export default pulsechainTestnetV4 From 29b05114435df2a86c8cb780d5e89ccb53434d73 Mon Sep 17 00:00:00 2001 From: JexxaJ <44744647+JexxaJ@users.noreply.github.com> Date: Mon, 6 Nov 2023 15:07:36 +0800 Subject: [PATCH 2/7] pulsechain network added --- provider/src/supportedNetworks.ts | 50 ++++++++++++++++--------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/provider/src/supportedNetworks.ts b/provider/src/supportedNetworks.ts index 5b091ffa7bb..df97cbf2af5 100644 --- a/provider/src/supportedNetworks.ts +++ b/provider/src/supportedNetworks.ts @@ -1,24 +1,26 @@ -import { Env } from './types' - -// This is the list of networks currently supported -const supportedNetworks = (env: Env, networkId: string): string | undefined => { - return { - '1': env.MAINNET_PROVIDER, - '5': env.GOERLI_PROVIDER, - '10': env.OPTIMISM_PROVIDER, - '56': env.BSC_PROVIDER, - '100': env.GNOSIS_PROVIDER, - '137': env.POLYGON_PROVIDER, - '42161': env.ARBITRUM_PROVIDER, - '42220': env.CELO_PROVIDER, - '43114': env.AVALANCHE_PROVIDER, - '80001': env.MUMBAI_PROVIDER, - '11297108109': env.PALM_PROVIDER, - '84531': env.BASE_GOERLI_PROVIDER, - '8453': env.BASE_PROVIDER, - '11155111': env.SEPOLIA_PROVIDER, - '59144': env.LINEA_PROVIDER, - }[networkId] -} - -export default supportedNetworks +import { Env } from './types' + +// This is the list of networks currently supported +const supportedNetworks = (env: Env, networkId: string): string | undefined => { + return { + '1': env.MAINNET_PROVIDER, + '5': env.GOERLI_PROVIDER, + '10': env.OPTIMISM_PROVIDER, + '56': env.BSC_PROVIDER, + '100': env.GNOSIS_PROVIDER, + '137': env.POLYGON_PROVIDER, + '42161': env.ARBITRUM_PROVIDER, + '42220': env.CELO_PROVIDER, + '43114': env.AVALANCHE_PROVIDER, + '80001': env.MUMBAI_PROVIDER, + '11297108109': env.PALM_PROVIDER, + '84531': env.BASE_GOERLI_PROVIDER, + '8453': env.BASE_PROVIDER, + '369': env.PULSECHAIN_PROVIDER, + '943': env.PULSECHAIN_TESTNETV4_PROVIDER, + '11155111': env.SEPOLIA_PROVIDER, + '59144': env.LINEA_PROVIDER, + }[networkId] +} + +export default supportedNetworks From bb8263861621c54c07b40875dec4e1dd9ba23ca2 Mon Sep 17 00:00:00 2001 From: JexxaJ <44744647+JexxaJ@users.noreply.github.com> Date: Mon, 6 Nov 2023 15:11:51 +0800 Subject: [PATCH 3/7] Pulsechain network settings --- provider/src/types.ts | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/provider/src/types.ts b/provider/src/types.ts index 844f20c6763..323ce884877 100644 --- a/provider/src/types.ts +++ b/provider/src/types.ts @@ -1,18 +1,20 @@ -export interface Env { - SENTRY_DSN: string - ARBITRUM_PROVIDER: string - AVALANCHE_PROVIDER: string - BSC_PROVIDER: string - CELO_PROVIDER: string - GNOSIS_PROVIDER: string - GOERLI_PROVIDER: string - MAINNET_PROVIDER: string - MUMBAI_PROVIDER: string - OPTIMISM_PROVIDER: string - POLYGON_PROVIDER: string - PALM_PROVIDER: string - BASE_GOERLI_PROVIDER: string - BASE_PROVIDER: string - SEPOLIA_PROVIDER: string - LINEA_PROVIDER: string -} +export interface Env { + SENTRY_DSN: string + ARBITRUM_PROVIDER: string + AVALANCHE_PROVIDER: string + BSC_PROVIDER: string + CELO_PROVIDER: string + GNOSIS_PROVIDER: string + GOERLI_PROVIDER: string + MAINNET_PROVIDER: string + MUMBAI_PROVIDER: string + OPTIMISM_PROVIDER: string + POLYGON_PROVIDER: string + PALM_PROVIDER: string + BASE_GOERLI_PROVIDER: string + BASE_PROVIDER: string + PULSECHAIN_PROVIDER: string + PULSECHAIN_TESTNETV4_PROVIDER: string + SEPOLIA_PROVIDER: string + LINEA_PROVIDER: string +} From 2d1e4eb119cbf548620db4fc4509928807086b27 Mon Sep 17 00:00:00 2001 From: JexxaJ <44744647+JexxaJ@users.noreply.github.com> Date: Tue, 7 Nov 2023 07:44:57 +0800 Subject: [PATCH 4/7] Update packages/networks/src/networks/pulsechain.ts Co-authored-by: Julien Genestoux --- packages/networks/src/networks/pulsechain.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/networks/src/networks/pulsechain.ts b/packages/networks/src/networks/pulsechain.ts index ff6675e5fcf..16b03639abd 100644 --- a/packages/networks/src/networks/pulsechain.ts +++ b/packages/networks/src/networks/pulsechain.ts @@ -19,7 +19,7 @@ export const pulsechain: NetworkConfig = { id: 369, isTestNetwork: false, keyManagerAddress: '', - maxFreeClaimCost: 10000, + maxFreeClaimCost: 0, multisig: '', name: 'pulsechain', nativeCurrency: { From 2f140a57f851b2222133088a488df8eecf822c81 Mon Sep 17 00:00:00 2001 From: JexxaJ <44744647+JexxaJ@users.noreply.github.com> Date: Tue, 7 Nov 2023 07:50:29 +0800 Subject: [PATCH 5/7] Update packages/networks/src/networks/pulsechain.ts Co-authored-by: Julien Genestoux --- packages/networks/src/networks/pulsechain.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/networks/src/networks/pulsechain.ts b/packages/networks/src/networks/pulsechain.ts index 16b03639abd..539798e1f5b 100644 --- a/packages/networks/src/networks/pulsechain.ts +++ b/packages/networks/src/networks/pulsechain.ts @@ -14,7 +14,8 @@ export const pulsechain: NetworkConfig = { transaction: (hash: string) => `https://scan.pulsechain.com/tx/${hash}`, }, }, - featured: true, + featured: false, + fullySubsidizedGas: false, id: 369, isTestNetwork: false, From efd7e8b020e11959f7e0eeff93743ce6d1b0ff5a Mon Sep 17 00:00:00 2001 From: JexxaJ <44744647+JexxaJ@users.noreply.github.com> Date: Tue, 7 Nov 2023 08:21:33 +0800 Subject: [PATCH 6/7] Update pulsechain.ts --- packages/networks/src/networks/pulsechain.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/networks/src/networks/pulsechain.ts b/packages/networks/src/networks/pulsechain.ts index 539798e1f5b..e64136ae841 100644 --- a/packages/networks/src/networks/pulsechain.ts +++ b/packages/networks/src/networks/pulsechain.ts @@ -2,7 +2,7 @@ import { NetworkConfig } from '@unlock-protocol/types' export const pulsechain: NetworkConfig = { chain: 'pulsechain', - description: 'pulsechain mainnet.', + description: 'Pulsechain is a full system state fork of Ethereum mainnet and maintains upstream compatliblity with the Ethereum code base. It provides lower gas costs and 10s block times and is supported by a community that places importance on permissionless protocols.', explorer: { name: 'Pulsechain', urls: { @@ -32,7 +32,7 @@ export const pulsechain: NetworkConfig = { previousDeploys: [], provider: 'https://rpc.unlock-protocol.com/369', publicLockVersionToDeploy: 13, - publicProvider: 'https://scan.pulsechain.com', + publicProvider: 'https://rpc.pulsechain.com', startBlock: 2247300, // Graph can be found at https://graph.pulsechain.com/ subgraph: { From 5e7de478b0bdebbec6a5b106e69bd96ad3c40fbf Mon Sep 17 00:00:00 2001 From: JexxaJ <44744647+JexxaJ@users.noreply.github.com> Date: Tue, 7 Nov 2023 08:23:59 +0800 Subject: [PATCH 7/7] Update pulsechainTestnetV4.ts --- packages/networks/src/networks/pulsechainTestnetV4.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/networks/src/networks/pulsechainTestnetV4.ts b/packages/networks/src/networks/pulsechainTestnetV4.ts index d3f249db9b4..38fcc465392 100644 --- a/packages/networks/src/networks/pulsechainTestnetV4.ts +++ b/packages/networks/src/networks/pulsechainTestnetV4.ts @@ -2,7 +2,7 @@ import { NetworkConfig } from '@unlock-protocol/types' export const pulsechainTestnetV4: NetworkConfig = { chain: 'pulsechainTestnetV4', - description: 'Pulsechain Testnet V4.', + description: 'Pulsechain Testnetv4 is the test ground for Pulsechain which is a full system state fork of Ethereum mainnet and maintains upstream compatliblity with the Ethereum code base. It provides lower gas costs and 10s block times and is supported by a community that places importance on permissionless protocols.', explorer: { name: 'pulsechainTestnetV4', urls: { @@ -30,7 +30,7 @@ export const pulsechainTestnetV4: NetworkConfig = { previousDeploys: [], provider: 'https://rpc.unlock-protocol.com/369', publicLockVersionToDeploy: 13, - publicProvider: 'https://scan.v4.testnet.pulsechain.com', + publicProvider: 'https://rpc.v4.testnet.pulsechain.com', startBlock: 2247300, // Graph can be found at https://scan.v4.testnet.pulsechain.com/graphiql/ subgraph: {