Skip to content

Commit 6463463

Browse files
authored
refactor: Rename lzChainId to lzEndpointId (#91)
1 parent 0774e60 commit 6463463

File tree

6 files changed

+24
-14
lines changed

6 files changed

+24
-14
lines changed

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ The bridge currently supports:
123123
#### **Testnets**
124124
- **Ethereum Sepolia****Arbitrum Sepolia**
125125

126-
#### **Mainnets**
126+
#### **Mainnets**
127127
- **Ethereum Mainnet****Arbitrum Mainnet**
128128

129129
### Bridge RLC on Testnets
@@ -333,14 +333,24 @@ The scripts automatically calculate these fees and include them in the transacti
333333
- [Forge Coverage](https://book.getfoundry.sh/reference/forge/forge-coverage)
334334
- [iExec Platform Documentation](https://docs.iex.ec/)
335335
336+
## How to release:
337+
338+
* First, deploy on Testnets and make sure all tests are ok.
339+
* Create a release branch `release/X.X.X` that starts from the `main` branch.
340+
- Note that GitHub environments `arbitrum` and `ethereum` can only be used with `release/*` branches. The `main` branch cannot be used as the CI will not be able to commit deployment artifacts.
341+
* Commit required changes (salt, ...)
342+
* Go to "Actions" section on GitHub
343+
* Trigger `Deploy contracts` job and choose the correct release branch and the target Github environment.
344+
336345
## TODO
337346
338347
- Use an enterprise RPC URL for `secrets.SEPOLIA_RPC_URL` in Github environment `ci`.
339348
- Add git pre-commit hook to format code locally.
340349
- Testing Documentation
341-
- Parametrize config.json to not overide btw mainnet and testnets
350+
- Parametrize the following addresses by chain in `config.json`:
342351
```
343352
"initialAdmin": "0x111165a109feca14e4ad4d805f6460c7d206ead1",
344353
"initialUpgrader": "0x111121e2ec2557f484f65d5b1ad2b6b07b8acd23",
345354
"initialPauser": "0x11113fe3513787f5a4f5f19690700e2736b3056e",
346-
```
355+
```
356+
- Clean README.md

config/config.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"iexecLayerZeroBridgeAddress": "0xA18e571f91ab58889C348E1764fBaBF622ab89b5",
1313
"iexecLayerZeroBridgeCreatexSalt": "0x4f2784ad07b2be2a5c5e466c91d758133f4aa33bd4cf09ddba1a1e1035e57875",
1414
"lzEndpointAddress": "0x6EDCE65403992e310A62460808c4b910D972f10f",
15-
"lzChainId": 40161
15+
"lzEndpointId": 40161
1616
},
1717
"arbitrum_sepolia": {
1818
"approvalRequired": false,
@@ -21,7 +21,7 @@
2121
"iexecLayerZeroBridgeAddress": "0xB560ae1dD7FdF011Ead2189510ae08f2dbD168a5",
2222
"iexecLayerZeroBridgeCreatexSalt": "0x4f2784ad07b2be2a5c5e466c91d758133f4aa33bd4cf09ddba1a1e1035e57875",
2323
"lzEndpointAddress": "0x6EDCE65403992e310A62460808c4b910D972f10f",
24-
"lzChainId": 40231
24+
"lzEndpointId": 40231
2525
},
2626
"ethereum": {
2727
"approvalRequired": true,
@@ -31,7 +31,7 @@
3131
"iexecLayerZeroBridgeAddress": "0xA8Bc0B19b955c8AC38C8Cbc9383866b834Cd33d8",
3232
"iexecLayerZeroBridgeCreatexSalt": "0x0000000000000000000000000000000000000000000000000000000000000000",
3333
"lzEndpointAddress": "0x1a44076050125825900e736c501f859c50fE728c",
34-
"lzChainId": 30101
34+
"lzEndpointId": 30101
3535
},
3636
"arbitrum": {
3737
"approvalRequired": false,
@@ -40,7 +40,7 @@
4040
"iexecLayerZeroBridgeAddress": "0x7000e96D0Bfc74cf5259aEDaE6065B39B3888699",
4141
"iexecLayerZeroBridgeCreatexSalt": "0x0000000000000000000000000000000000000000000000000000000000000001",
4242
"lzEndpointAddress": "0x1a44076050125825900e736c501f859c50fE728c",
43-
"lzChainId": 30110
43+
"lzEndpointId": 30110
4444
}
4545
}
4646
}

script/SendFromArbitrumToEthereum.s.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ contract SendFromArbitrumToEthereum is Script {
4949

5050
// Prepare send parameters
5151
SendParam memory sendParam = SendParam(
52-
uint16(targetParams.lzChainId), // Destination endpoint ID
52+
uint16(targetParams.lzEndpointId), // Destination endpoint ID
5353
addressToBytes32(recipient), // Recipient address
5454
TRANSFER_AMOUNT, // Amount to send in local decimals
5555
TRANSFER_AMOUNT * 99 / 100, // Minimum amount to send (allowing 1% slippage)

script/SendFromEthereumToArbitrum.s.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ contract SendFromEthereumToArbitrum is Script {
4545

4646
// Prepare send parameters
4747
SendParam memory sendParam = SendParam(
48-
uint16(targetParams.lzChainId), // Destination endpoint ID
48+
uint16(targetParams.lzEndpointId), // Destination endpoint ID
4949
addressToBytes32(recipient), // Recipient address
5050
TRANSFER_AMOUNT, // Amount to send in local decimals
5151
TRANSFER_AMOUNT * 99 / 100, // Minimum amount to send (allowing 1% slippage)

script/bridges/layerZero/IexecLayerZeroBridge.s.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ contract Configure is Script {
7070
IexecLayerZeroBridge sourceBridge = IexecLayerZeroBridge(sourceParams.iexecLayerZeroBridgeAddress);
7171
vm.startBroadcast();
7272
sourceBridge.setPeer(
73-
targetParams.lzChainId, bytes32(uint256(uint160(targetParams.iexecLayerZeroBridgeAddress)))
73+
targetParams.lzEndpointId, bytes32(uint256(uint160(targetParams.iexecLayerZeroBridgeAddress)))
7474
);
7575
EnforcedOptionParam[] memory enforcedOptions = new EnforcedOptionParam[](2);
7676
bytes memory _extraOptions = OptionsBuilder.newOptions().addExecutorLzReceiveOption(90_000, 0); // 90_000 gas limit for the receiving executor and 0 for the executor's value
77-
enforcedOptions[0] = EnforcedOptionParam(targetParams.lzChainId, 1, _extraOptions); // lzReceive
78-
enforcedOptions[1] = EnforcedOptionParam(targetParams.lzChainId, 2, _extraOptions); // lzCompose
77+
enforcedOptions[0] = EnforcedOptionParam(targetParams.lzEndpointId, 1, _extraOptions); // lzReceive
78+
enforcedOptions[1] = EnforcedOptionParam(targetParams.lzEndpointId, 2, _extraOptions); // lzCompose
7979
sourceBridge.setEnforcedOptions(enforcedOptions);
8080
// Authorize bridge in the relevant contract.
8181
if (sourceParams.approvalRequired) {

script/lib/ConfigLib.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ library ConfigLib {
2525
address initialUpgrader;
2626
address createxFactory;
2727
address lzEndpoint;
28-
uint32 lzChainId;
28+
uint32 lzEndpointId;
2929
address rlcToken; // RLC token address (already deployed on L1)
3030
bytes32 rlcLiquidityUnifierCreatexSalt; // Salt for CreateX deployment of the RLC Liquidity Unifier
3131
address rlcLiquidityUnifierAddress; // RLC Liquidity Unifier address (only on L1)
@@ -118,7 +118,7 @@ library ConfigLib {
118118
params.approvalRequired = config.readBool(string.concat(prefix, ".approvalRequired"));
119119
params.iexecLayerZeroBridgeAddress = config.readAddress(string.concat(prefix, ".iexecLayerZeroBridgeAddress"));
120120
params.lzEndpoint = config.readAddress(string.concat(prefix, ".lzEndpointAddress"));
121-
params.lzChainId = uint32(config.readUint(string.concat(prefix, ".lzChainId")));
121+
params.lzEndpointId = uint32(config.readUint(string.concat(prefix, ".lzEndpointId")));
122122
}
123123

124124
/**

0 commit comments

Comments
 (0)