Skip to content

Commit d9cfaf6

Browse files
authored
feat: Add x layer (#77)
* feat: Add x layer * fix: move to XLayer
1 parent bf955b8 commit d9cfaf6

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ deploy-avalanche :; forge script script/DeployTransparentProxyFactory.s.sol:Depl
1515
deploy-optimism :; forge script script/DeployTransparentProxyFactory.s.sol:DeployOptimism --rpc-url optimism --broadcast --legacy --ledger --mnemonic-indexes ${MNEMONIC_INDEX} --sender ${LEDGER_SENDER} --verify -vvvv
1616
deploy-arbitrum :; forge script script/DeployTransparentProxyFactory.s.sol:DeployArbitrum --rpc-url arbitrum --broadcast --legacy --ledger --mnemonic-indexes ${MNEMONIC_INDEX} --sender ${LEDGER_SENDER} --verify -vvvv
1717
deploy-zksync :; FOUNDRY_PROFILE=zksync forge script zksync/script/DeployTransparentProxyFactoryZkSync.s.sol:DeployZkSync --zksync --system-mode=true --rpc-url zksync --broadcast --ledger --mnemonic-indexes ${MNEMONIC_INDEX} --sender ${LEDGER_SENDER} --verify -vvvv
18-
18+
deploy-xlayer :; forge script script/DeployTransparentProxyFactory.s.sol:DeployTransparentProxyFactory --rpc-url xlayer --broadcast --ledger --mnemonic-indexes ${MNEMONIC_INDEX} --sender ${LEDGER_SENDER} --verify --legacy -vvvv
1919
# ---------------------------------------------- BASE SCRIPT CONFIGURATION ---------------------------------------------
2020

2121
BASE_LEDGER = --ledger --mnemonic-indexes $(MNEMONIC_INDEX) --sender $(LEDGER_SENDER)

foundry.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ zksync = "${RPC_ZKSYNC}"
6161
linea = "${RPC_LINEA}"
6262
soneium = "${RPC_SONEIUM}"
6363
bob = "${RPC_BOB}"
64+
xlayer = "${RPC_XLAYER}"
6465

6566
[fuzz]
6667
no_zksync_reserved_addresses = true

src/contracts/utils/ChainHelpers.sol

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ library ChainIds {
2828
uint256 internal constant SONEIUM = 1868;
2929
uint256 internal constant BOB = 60808;
3030
uint256 internal constant PLASMA = 9745;
31+
uint256 internal constant XLAYER = 196;
3132
}
3233

3334
library TestNetChainIds {
@@ -51,6 +52,7 @@ library TestNetChainIds {
5152
uint256 internal constant SONEIUM_MINATO = 1946;
5253
uint256 internal constant BOB_SEPOLIA = 808813;
5354
uint256 internal constant PLASMA_TESTNET = 9746;
55+
uint256 internal constant XLAYER_TESTNET = 1952;
5456
}
5557

5658
library ChainHelpers {
@@ -108,6 +110,8 @@ library ChainHelpers {
108110
newFork = vm.createSelectFork(vm.rpcUrl('bob'));
109111
} else if (chainId == ChainIds.PLASMA) {
110112
newFork = vm.createSelectFork(vm.rpcUrl('plasma'));
113+
} else if (chainId == ChainIds.XLAYER) {
114+
newFork = vm.createSelectFork(vm.rpcUrl('xlayer'));
111115
} else {
112116
revert UnknownChainId();
113117
}
@@ -156,6 +160,8 @@ library ChainHelpers {
156160
networkName = 'bob';
157161
} else if (chainId == ChainIds.PLASMA) {
158162
networkName = 'plasma';
163+
} else if (chainId == ChainIds.XLAYER) {
164+
networkName = 'xlayer';
159165
}
160166
// testnets
161167
else if (chainId == TestNetChainIds.ETHEREUM_SEPOLIA) {
@@ -194,6 +200,8 @@ library ChainHelpers {
194200
networkName = 'bob_sepolia';
195201
} else if (chainId == TestNetChainIds.PLASMA_TESTNET) {
196202
networkName = 'plasma_testnet';
203+
} else if (chainId == TestNetChainIds.XLAYER_TESTNET) {
204+
networkName = 'xlayer_testnet';
197205
} else {
198206
revert('chain id is not supported');
199207
}

src/contracts/utils/ScriptUtils.sol

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ abstract contract PlasmaScript is WithChainIdValidation {
111111
constructor() WithChainIdValidation(ChainIds.PLASMA) {}
112112
}
113113

114+
abstract contract XLayerScript is WithChainIdValidation {
115+
constructor() WithChainIdValidation(ChainIds.XLAYER) {}
116+
}
117+
114118
library Create2Utils {
115119
// https://github.com/safe-global/safe-singleton-factory
116120
address public constant CREATE2_FACTORY = 0x914d7Fec6aaC8cd542e72Bca78B30650d45643d7;

0 commit comments

Comments
 (0)