Skip to content

Commit

Permalink
feat: support scroll sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
dudu0506 committed Sep 25, 2024
1 parent 62ffa51 commit 3634102
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/plugins/RedPacket/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const base: Plugin.Shared.Definition = {
ChainId.Scroll,
ChainId.Metis,
ChainId.XLayer,
ChainId.ScrollSDK,
],
},
[NetworkPluginID.PLUGIN_FLOW]: { supportedChainIds: [] },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const useStyles = makeStyles<StyleProps>()((theme, { compact, isList }) => ({
position: 'relative',
},
sidebarContainer: {
paddingBottom: '36px',
width: 27,
height: isList ? 486 : undefined,
},
Expand Down
6 changes: 4 additions & 2 deletions packages/web3-constants/evm/red-packet.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"Scroll": "0x16f61cb37169523635B6761f3C946892fb3c18fB",
"Metis": "0x2cf91AD8C175305EBe6970Bd8f81231585EFbd77",
"XLayer": "0xDb847f1D8099C5b15519ECfd0b0C981d719bccE6",
"XLayer_Testnet": "0x977baB5f7e2cEd0C91fDA890Ed1DBDfD3Ee9AE81"
"XLayer_Testnet": "0x977baB5f7e2cEd0C91fDA890Ed1DBDfD3Ee9AE81",
"ScrollSDK": "0xb20c685281A43581A2B4A54F613431273E5c8613"
},
"HAPPY_RED_PACKET_ADDRESS_V4_BLOCK_HEIGHT": {
"Mainnet": 12939427,
Expand Down Expand Up @@ -70,6 +71,7 @@
"Scroll": 96705,
"Metis": 1702860,
"XLayer": 0,
"XLayer_Testnet": 7320220
"XLayer_Testnet": 7320220,
"ScrollSDK": 0
}
}
9 changes: 6 additions & 3 deletions packages/web3-constants/evm/rpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
"Scroll": ["https://rpc.scroll.io"],
"Metis": ["https://andromeda.metis.io/?owner=1088"],
"XLayer": ["https://rpc.xlayer.tech"],
"XLayer_Testnet": ["https://testrpc.xlayer.tech"]
"XLayer_Testnet": ["https://testrpc.xlayer.tech"],
"ScrollSDK": ["http://l2-rpc.scrollsdk"]
},
"RPC_URLS_OFFICIAL": {
"Mainnet": ["https://mainnet.infura.io/v3/d65858b010d249419cf8687eca12b094"],
Expand Down Expand Up @@ -104,7 +105,8 @@
"Scroll": ["https://rpc.scroll.io"],
"Metis": ["https://andromeda.metis.io/?owner=1088"],
"XLayer": ["https://rpc.xlayer.tech"],
"XLayer_Testnet": ["https://testrpc.xlayer.tech"]
"XLayer_Testnet": ["https://testrpc.xlayer.tech"],
"ScrollSDK": ["http://l2-rpc.scrollsdk"]
},
"RPC_WEIGHTS": {
"Mainnet": [0, 1, 2, 3, 4],
Expand Down Expand Up @@ -135,6 +137,7 @@
"Scroll": [0, 0, 0, 0, 0],
"Metis": [0, 0, 0, 0, 0],
"XLayer": [0, 0, 0, 0, 0],
"XLayer_Testnet": [0, 0, 0, 0, 0]
"XLayer_Testnet": [0, 0, 0, 0, 0],
"ScrollSDK": [0, 0, 0, 0, 0]
}
}
30 changes: 29 additions & 1 deletion packages/web3-shared/evm/src/constants/chains.json
Original file line number Diff line number Diff line change
Expand Up @@ -1376,5 +1376,33 @@
"url": "https://explorer.linea.build"
}
]
},
{
"chainId": 221122,
"type": "ScrollSDK",
"name": "ScrollSDK",
"network": "mainnet",
"fullName": "ScrollSDK",
"shortName": "ScrollSDK",
"rpc": ["http://l2-rpc.scrollsdk"],
"faucets": [],
"features": [],
"nativeCurrency": {
"chainId": 221122,
"name": "Ether",
"symbol": "ETH",
"decimals": 18,
"logoURL": "https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/ethereum/info/logo.png/quality=85"
},
"defaultGasLimit": "90000",
"minGasLimit": "21000",
"infoURL": "http://blockscout.scrollsdk/",
"explorers": [
{
"name": "blockscout",
"url": "http://blockscout.scrollsdk/",
"standard": "EIP3091"
}
]
}
]
]
13 changes: 13 additions & 0 deletions packages/web3-shared/evm/src/constants/descriptors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,19 @@ export const NETWORK_DESCRIPTORS: ReadonlyArray<NetworkDescriptor<ChainId, Netwo
isMainnet: true,
averageBlockDelay: 10,
},
{
ID: `${PLUGIN_ID}_scroll-sdk`,
networkSupporterPluginID: PLUGIN_ID,
chainId: ChainId.ScrollSDK,
type: NetworkType.ScrollSDK,
name: 'ScrollSDK',
icon: new URL('../assets/scroll.svg', import.meta.url).href,
backgroundGradient:
'linear-gradient(180deg, rgba(98, 126, 234, 0.15) 0%, rgba(98, 126, 234, 0.05) 100%), rgba(255, 255, 255, 0.2)',
iconColor: 'rgb(255, 248, 243)',
averageBlockDelay: 9,
isMainnet: true,
},
]

export const CHAIN_DESCRIPTORS: ReadonlyArray<ChainDescriptor<ChainId, SchemaType, NetworkType>> = CHAINS.map((x) => {
Expand Down
3 changes: 3 additions & 0 deletions packages/web3-shared/evm/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ export enum ChainId {
ZkSyncEra = 324,

Linea = 59144,

ScrollSDK = 221122,
}

export enum AddressType {
Expand Down Expand Up @@ -311,6 +313,7 @@ export enum NetworkType {
Zora = 'Zora',
ZkSyncEra = 'ZkSyncEra',
Linea = 'Linea',
ScrollSDK = 'ScrollSDK',
}

export enum ProviderType {
Expand Down

0 comments on commit 3634102

Please sign in to comment.