Skip to content

Commit

Permalink
feat(pg): Support Astar zkEVM, Mantle, Crab, Darwinia
Browse files Browse the repository at this point in the history
  • Loading branch information
RPate97 committed Apr 29, 2024
1 parent 58ccea4 commit 89d421b
Show file tree
Hide file tree
Showing 7 changed files with 286 additions and 21 deletions.
6 changes: 6 additions & 0 deletions .changeset/popular-carrots-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@sphinx-labs/contracts': patch
'@sphinx-labs/plugins': patch
---

Support Astart zkEVM, Mantle, Crab
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ Please feel free to reach out to us in our [Discord](https://discord.gg/7Gc3DK33
- Rootstock
- Blast
- Mode
- Mantle
- Darwinia
- Crab
- Astar zkEVM

Test networks:

Expand All @@ -135,6 +139,8 @@ Test networks:
- Blast Sepolia
- Darwinia Pangolin
- Taiko Katla
- Mantle Sepolia
- Astar zKyoto

More networks are on the way! Please reach out to us in our [Discord](https://discord.gg/7Gc3DK33Np) if there are networks you'd like us to add.

Expand Down
58 changes: 56 additions & 2 deletions packages/contracts/contracts/foundry/SphinxConstants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ contract SphinxConstants {
address public constant safeSingletonAddress = 0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552;
address public constant sphinxModuleImplAddress = 0x8f4E4d51B8050B0ff713eff1F88f3dD8b5e8a530;

uint8 internal constant numSupportedNetworks = 47;
uint8 internal constant numSupportedNetworks = 53;

function getNetworkInfoArray() public pure returns (NetworkInfo[] memory) {
NetworkInfo[] memory all = new NetworkInfo[](numSupportedNetworks);
Expand Down Expand Up @@ -394,6 +394,54 @@ contract SphinxConstants {
dripSize: 1000000000000000000,
dripSizeString: '1 RING'
});
all[47] = NetworkInfo({
network: Network.mantle_sepolia,
name: "mantle_sepolia",
chainId: 5003,
networkType: NetworkType.Testnet,
dripSize: 5000000000000000000,
dripSizeString: '5 MNT'
});
all[48] = NetworkInfo({
network: Network.mantle,
name: "mantle",
chainId: 5000,
networkType: NetworkType.Mainnet,
dripSize: 5000000000000000000,
dripSizeString: '5 MNT'
});
all[49] = NetworkInfo({
network: Network.astar_zkyoto,
name: "astar_zkyoto",
chainId: 6038361,
networkType: NetworkType.Testnet,
dripSize: 150000000000000000,
dripSizeString: '0.15 ETH'
});
all[50] = NetworkInfo({
network: Network.astar,
name: "astar",
chainId: 3776,
networkType: NetworkType.Mainnet,
dripSize: 25000000000000000,
dripSizeString: '0.025 ETH'
});
all[51] = NetworkInfo({
network: Network.crab,
name: "crab",
chainId: 44,
networkType: NetworkType.Mainnet,
dripSize: 1000000000000000000,
dripSizeString: '1 CRAB'
});
all[52] = NetworkInfo({
network: Network.darwinia,
name: "darwinia",
chainId: 46,
networkType: NetworkType.Mainnet,
dripSize: 1000000000000000000,
dripSizeString: '1 RING'
});
return all;
}
}
Expand Down Expand Up @@ -445,5 +493,11 @@ enum Network {
taiko_katla,
mode_sepolia,
mode,
darwinia_pangolin
darwinia_pangolin,
mantle_sepolia,
mantle,
astar_zkyoto,
astar,
crab,
darwinia
}
146 changes: 146 additions & 0 deletions packages/contracts/src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,152 @@ export const SPHINX_NETWORKS: Array<SupportedNetwork> = [
hardcodedMerkleLeafGas: (11200000).toString(),
actionTransactionBatching: false,
},
{
name: 'mantle_sepolia',
displayName: 'Mantle Sepolia',
chainId: BigInt(5003),
rpcUrl: () => process.env.MANTLE_SEPOLIA_URL!,
rpcUrlId: 'MANTLE_SEPOLIA_URL',
blockexplorers: {
blockscout: {
browserURL: 'https://explorer.sepolia.mantle.xyz/',
apiURL: 'https://explorer.sepolia.mantle.xyz/api',
envKey: 'MANTLE_SEPOLIA_BLOCKSCOUT_API_KEY',
selfHosted: false,
},
},
currency: 'MNT',
dripSize: '5',
networkType: 'Testnet',
dripVersion: 1,
decimals: 18,
queryFilterBlockLimit: 2000,
legacyTx: false,
actionGasLimitBuffer: false,
eip2028: true,
actionTransactionBatching: false,
},
{
name: 'mantle',
displayName: 'Mantle',
chainId: BigInt(5000),
rpcUrl: () => process.env.MANTLE_MAINNET_URL!,
rpcUrlId: 'MANTLE_MAINNET_URL',
blockexplorers: {
blockscout: {
browserURL: 'https://explorer.mantle.xyz/',
apiURL: 'https://explorer.mantle.xyz/api',
envKey: 'MANTLE_BLOCKSCOUT_API_KEY',
selfHosted: false,
},
},
currency: 'MNT',
dripSize: '5',
networkType: 'Mainnet',
dripVersion: 1,
decimals: 18,
queryFilterBlockLimit: 2000,
legacyTx: false,
actionGasLimitBuffer: false,
eip2028: true,
actionTransactionBatching: false,
},
{
name: 'astar_zkyoto',
displayName: 'Astar zKyoto',
chainId: BigInt(6038361),
rpcUrl: () => process.env.ASTAR_ZKYOTO_URL!,
rpcUrlId: 'ASTAR_ZKYOTO_URL',
blockexplorers: {
blockscout: {
browserURL: 'https://zkyoto.explorer.startale.com/',
apiURL: 'https://zkyoto.explorer.startale.com/api',
envKey: 'ASTAR_ZKYOTO_BLOCKSCOUT_API_KEY',
selfHosted: false,
},
},
currency: 'ETH',
dripSize: '0.15',
networkType: 'Testnet',
dripVersion: 0,
decimals: 18,
queryFilterBlockLimit: 2000,
legacyTx: false,
actionGasLimitBuffer: false,
eip2028: true,
actionTransactionBatching: false,
rollupStack: {
provider: 'None',
type: 'Polygon CDK',
},
},
{
name: 'astar',
displayName: 'Astar zkEVM',
chainId: BigInt(3776),
rpcUrl: () => process.env.ASTAR_MAINNET_URL!,
rpcUrlId: 'ASTAR_MAINNET_URL',
blockexplorers: {
blockscout: {
browserURL: 'https://astar-zkevm.explorer.startale.com/',
apiURL: 'https://astar-zkevm.explorer.startale.com/api',
envKey: 'ASTAR_BLOCKSCOUT_API_KEY',
selfHosted: false,
},
},
currency: 'ETH',
dripSize: '0.025',
networkType: 'Mainnet',
dripVersion: 0,
decimals: 18,
queryFilterBlockLimit: 2000,
legacyTx: false,
actionGasLimitBuffer: false,
eip2028: true,
actionTransactionBatching: false,
rollupStack: {
provider: 'None',
type: 'Polygon CDK',
},
},
{
name: 'crab',
displayName: 'Crab',
chainId: BigInt(44),
rpcUrl: () => process.env.DARWINIA_CRAB_MAINNET_URL!,
rpcUrlId: 'DARWINIA_CRAB_MAINNET_URL',
blockexplorers: {},
currency: 'CRAB',
dripSize: '1',
networkType: 'Mainnet',
dripVersion: 0,
decimals: 18,
queryFilterBlockLimit: 2000,
legacyTx: false,
actionGasLimitBuffer: false,
eip2028: true,
hardcodedMerkleLeafGas: (11200000).toString(),
actionTransactionBatching: false,
},
{
name: 'darwinia',
displayName: 'Darwinia',
chainId: BigInt(46),
rpcUrl: () => process.env.DARWINIA_MAINNET_URL!,
rpcUrlId: 'DARWINIA_MAINNET_URL',
blockexplorers: {},
currency: 'RING',
dripSize: '1',
networkType: 'Mainnet',
dripVersion: 0,
decimals: 18,
queryFilterBlockLimit: 2000,
legacyTx: false,
actionGasLimitBuffer: false,
eip2028: true,
hardcodedMerkleLeafGas: (11200000).toString(),
actionTransactionBatching: false,
},
]

export const DEPRECATED_SPHINX_NETWORKS = [
Expand Down
Loading

0 comments on commit 89d421b

Please sign in to comment.