Skip to content

Commit 5ff3398

Browse files
committed
feat: Implement cross-chain transfer scripts for RLC tokens between Arbitrum and Ethereum
- Added SendArbitrumToEthereum script to facilitate token transfers from Arbitrum to Ethereum Sepolia. - Introduced SendParam structure for transfer parameters and fee estimation. - Created JSON files to log transaction details for two separate runs. - Updated SendEthereumToArbitrum script to remove unnecessary refund address variable.
1 parent 0fd43c7 commit 5ff3398

File tree

7 files changed

+508
-14
lines changed

7 files changed

+508
-14
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ docs/
1212

1313
# Dotenv file
1414
.env
15+
.last_deploy.json

Makefile

Lines changed: 75 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
# Makefile for RLC OFT Project
22
-include .env
3-
# Configuration
4-
NETWORK ?= sepolia
5-
RPC_URL_SEPOLIA ?="https://lb.drpc.org/ogrpc?network=sepolia&dkey=<>"
6-
RPC_URL_ARBITRUM_SEPOLIA ?= "https://lb.drpc.org/ogrpc?network=arbitrum-sepolia&dkey=<>"
7-
ETHERSCAN_API_KEY ?= <>
8-
ACCOUNT ?= iexec-gabriel-mm-dev
93

4+
.PHONY: deploy-test
105
# Default target
116
help:
127
@echo "Available commands:"
@@ -22,44 +17,111 @@ help:
2217
@echo " make test - Run tests"
2318
@echo " make clean - Clean artifacts"
2419
@echo ""
25-
@echo "Usage: make COMMAND [NETWORK=sepolia|arbitrum_sepolia] [ACCOUNT=...] [...]"
20+
@echo "Usage: make COMMAND [ACCOUNT=...] [...]"
2621

2722
# Deployment targets
2823
deploy-adapter:
29-
@echo "Deploying RLCAdapter on $(NETWORK)..."
24+
@echo "Deploying RLCAdapter on SEPOLIA..."
3025
forge script script/RLCAdapter.s.sol:DeployRLCAdapter \
3126
--rpc-url $(RPC_URL_SEPOLIA) \
3227
--account $(ACCOUNT) \
3328
--broadcast \
3429
-vvv
3530

3631
deploy-oft:
37-
@echo "Deploying RLCOFT on $(NETWORK)..."
32+
@echo "Deploying RLCOFT on Arbitrum SEPOLIA..."
3833
forge script script/RLCOFT.s.sol:DeployRLCOFT \
3934
--rpc-url $(RPC_URL_ARBITRUM_SEPOLIA) \
4035
--account $(ACCOUNT) \
4136
--broadcast \
4237
-vvv \
4338

4439
conf-adapter:
45-
@echo "Configuring RLCAdapter on $(NETWORK)..."
40+
@echo "Configuring RLCAdapter on SEPOLIA..."
4641
forge script script/ConfigureRLCAdapter.s.sol:ConfigureRLCAdapter \
4742
--rpc-url $(RPC_URL_SEPOLIA) \
4843
--account $(ACCOUNT) \
4944
--broadcast \
5045
-vvv
5146
conf-oft:
52-
@echo "Configuring RLCOFT on $(NETWORK)..."
47+
@echo "Configuring RLCOFT on Arbitrum SEPOLIA..."
5348
forge script script/ConfigureRLCOFT.s.sol:ConfigureRLCOFT \
5449
--rpc-url $(RPC_URL_ARBITRUM_SEPOLIA) \
5550
--account $(ACCOUNT) \
5651
--broadcast \
5752
-vvv
5853

5954
send-tokens:
60-
@echo "Sending tokens cross-chain..."
55+
@echo "Sending tokens cross-chain... from SEPOLIA to Arbitrum SEPOLIA"
6156
forge script script/SendEthereumToArbitrum.s.sol:SendEthereumToArbitrum \
6257
--rpc-url $(RPC_URL_SEPOLIA) \
6358
--account $(ACCOUNT) \
6459
--broadcast \
65-
-vvv
60+
-vvv
61+
62+
.PHONY: send-tokens-arbitrum-sepolia
63+
send-tokens-arbitrum-sepolia:
64+
@echo "Sending tokens cross-chain... from Arbitrum SEPOLIA to SEPOLIA"
65+
@source .env && forge script script/SendArbitrumToEthereum.s.sol:SendArbitrumToEthereum \
66+
--rpc-url $(RPC_URL_ARBITRUM_SEPOLIA) \
67+
--account $(ACCOUNT) \
68+
--broadcast \
69+
-vvv
70+
# set-receive-handler:
71+
# @echo "Setting receive handler..."
72+
# forge script script/SetReceiveHandler.s.sol:SetReceiveHandlerScript \
73+
# --rpc-url SEPOLIA \
74+
# --account $(ACCOUNT) \
75+
# --broadcast \
76+
# -vvv
77+
# # Verification targets
78+
# .PHONY: verify-adapter
79+
# verify-adapter:
80+
# @echo "Verifying RLCAdapter on SEPOLIA..."
81+
# forge verify-contract \
82+
# --chain-id $(shell forge chain-id --rpc-url SEPOLIA) \
83+
# --compiler-version v0.8.22 \
84+
# --constructor-args $(shell cast abi-encode "constructor(address,address,address)" $(TOKEN_ADDRESS) $(ENDPOINT_ADDRESS_SEPOLIA) $(DELEGATE_ADDRESS)) \
85+
# --etherscan-api-key $(ETHERSCAN_API_KEY) \
86+
# $(ADAPTER_ADDRESS) \
87+
# src/RLCAdapter.sol:RLCAdapter
88+
89+
# .PHONY: verify-oft
90+
# verify-oft:
91+
# @echo "Verifying RLCOFT on SEPOLIA..."
92+
# forge verify-contract \
93+
# --chain-id $(shell forge chain-id --rpc-url SEPOLIA) \
94+
# --compiler-version v0.8.22 \
95+
# --constructor-args $(shell cast abi-encode "constructor(string,string,address,address)" $(TOKEN_NAME) $(TOKEN_SYMBOL) $(ENDPOINT_ADDRESS_SEPOLIA) $(DELEGATE_ADDRESS)) \
96+
# --etherscan-api-key $(ETHERSCAN_API_KEY) \
97+
# $(OFT_ADDRESS) \
98+
# src/RLCOFT.sol:RLCOFT
99+
100+
# Interaction targets
101+
102+
103+
estimate-fee:
104+
@echo "Estimating fee for cross-chain transfer..."
105+
forge script script/EstimateFee.s.sol:EstimateFeeScript \
106+
--rpc-url SEPOLIA \
107+
--account $(ACCOUNT) \
108+
-vvv
109+
110+
111+
112+
burn:
113+
@echo "Burning tokens..."
114+
forge script script/BurnTokens.s.sol:BurnTokensScript \
115+
--rpc-url SEPOLIA \
116+
--account $(ACCOUNT) \
117+
--broadcast \
118+
-vvv
119+
120+
# Test and utility targets
121+
test:
122+
@echo "Running tests..."
123+
forge test -vvv
124+
125+
clean:
126+
@echo "Cleaning artifacts..."
127+
forge clean
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
{
2+
"transactions": [
3+
{
4+
"hash": "0x7e67e3e199683af23ea7dc5c27cc57f13382a56f0658eea3cc2a9475228fc7fc",
5+
"transactionType": "CALL",
6+
"contractName": null,
7+
"contractAddress": "0x435e2293653a3e80c93290803faa0d152181b835",
8+
"function": "send((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),(uint256,uint256),address)",
9+
"arguments": [
10+
"(40161, 0x000000000000000000000000316a389d7f0ac46b19fcbe7076f125566f09cebc, 5000000000000, 4500000000000, 0x0003010021010000000000000000000000000000fde800000000000000000000000000000000, 0x, 0x)",
11+
"(1650940778031513, 0)",
12+
"0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38"
13+
],
14+
"transaction": {
15+
"from": "0x316a389d7f0ac46b19fcbe7076f125566f09cebc",
16+
"to": "0x435e2293653a3e80c93290803faa0d152181b835",
17+
"gas": "0x530c4",
18+
"value": "0x5dd859a9ea999",
19+
"input": "0xc7c7f5b300000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000005dd859a9ea99900000000000000000000000000000000000000000000000000000000000000000000000000000000000000001804c8ab1f12e6bbf3894d4083f33e07309d1f380000000000000000000000000000000000000000000000000000000000009ce1000000000000000000000000316a389d7f0ac46b19fcbe7076f125566f09cebc0000000000000000000000000000000000000000000000000000048c2739500000000000000000000000000000000000000000000000000000000417bce6c80000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000260003010021010000000000000000000000000000fde800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
20+
"nonce": "0x7",
21+
"chainId": "0x66eee"
22+
},
23+
"additionalContracts": [],
24+
"isFixedGasLimit": false
25+
}
26+
],
27+
"receipts": [
28+
{
29+
"status": "0x1",
30+
"cumulativeGasUsed": "0x98210",
31+
"logs": [
32+
{
33+
"address": "0x435e2293653a3e80c93290803faa0d152181b835",
34+
"topics": [
35+
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
36+
"0x000000000000000000000000316a389d7f0ac46b19fcbe7076f125566f09cebc",
37+
"0x0000000000000000000000000000000000000000000000000000000000000000"
38+
],
39+
"data": "0x0000000000000000000000000000000000000000000000000000048c27395000",
40+
"blockHash": "0xbc5f23b76034a9090855f4ddf8af02b93c6900a81cd293747272470201aaf6c7",
41+
"blockNumber": "0x9181409",
42+
"transactionHash": "0x7e67e3e199683af23ea7dc5c27cc57f13382a56f0658eea3cc2a9475228fc7fc",
43+
"transactionIndex": "0x3",
44+
"logIndex": "0x4",
45+
"removed": false
46+
},
47+
{
48+
"address": "0x4f7cd4da19abb31b0ec98b9066b9e857b1bf9c0e",
49+
"topics": [
50+
"0x61ed099e74a97a1d7f8bb0952a88ca8b7b8ebd00c126ea04671f92a81213318a"
51+
],
52+
"data": "0x0000000000000000000000005df3a1cebbd9c8ba7f8df51fd632a9aef830889700000000000000000000000000000000000000000000000000038cc5292a9c00",
53+
"blockHash": "0xbc5f23b76034a9090855f4ddf8af02b93c6900a81cd293747272470201aaf6c7",
54+
"blockNumber": "0x9181409",
55+
"transactionHash": "0x7e67e3e199683af23ea7dc5c27cc57f13382a56f0658eea3cc2a9475228fc7fc",
56+
"transactionIndex": "0x3",
57+
"logIndex": "0x5",
58+
"removed": false
59+
},
60+
{
61+
"address": "0x4f7cd4da19abb31b0ec98b9066b9e857b1bf9c0e",
62+
"topics": [
63+
"0x07ea52d82345d6e838192107d8fd7123d9c2ec8e916cd0aad13fd2b60db24644"
64+
],
65+
"data": "0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000053f488e93b4f1b60e8e83aa374dbe1780a1ee8a800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000250c071740d99",
66+
"blockHash": "0xbc5f23b76034a9090855f4ddf8af02b93c6900a81cd293747272470201aaf6c7",
67+
"blockNumber": "0x9181409",
68+
"transactionHash": "0x7e67e3e199683af23ea7dc5c27cc57f13382a56f0658eea3cc2a9475228fc7fc",
69+
"transactionIndex": "0x3",
70+
"logIndex": "0x6",
71+
"removed": false
72+
},
73+
{
74+
"address": "0x6edce65403992e310a62460808c4b910d972f10f",
75+
"topics": [
76+
"0x1ab700d4ced0c005b164c0f789fd09fcbb0156d4c2041b8a3bfbcd961cd1567f"
77+
],
78+
"data": "0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000004f7cd4da19abb31b0ec98b9066b9e857b1bf9c0e000000000000000000000000000000000000000000000000000000000000009901000000000000000100009d27000000000000000000000000435e2293653a3e80c93290803faa0d152181b83500009ce10000000000000000000000002f8b13a6882e4c4ea52d6588510fb7dfbd09e4e5b85e1a2b4d515b9b96c662a5de7433a665756a1e4aa0b1f7c3b449568d512be5000000000000000000000000316a389d7f0ac46b19fcbe7076f125566f09cebc00000000000000050000000000000000000000000000000000000000000000000000000000000000000000000000260003010021010000000000000000000000000000fde8000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
79+
"blockHash": "0xbc5f23b76034a9090855f4ddf8af02b93c6900a81cd293747272470201aaf6c7",
80+
"blockNumber": "0x9181409",
81+
"transactionHash": "0x7e67e3e199683af23ea7dc5c27cc57f13382a56f0658eea3cc2a9475228fc7fc",
82+
"transactionIndex": "0x3",
83+
"logIndex": "0x7",
84+
"removed": false
85+
},
86+
{
87+
"address": "0x435e2293653a3e80c93290803faa0d152181b835",
88+
"topics": [
89+
"0x85496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a",
90+
"0xb85e1a2b4d515b9b96c662a5de7433a665756a1e4aa0b1f7c3b449568d512be5",
91+
"0x000000000000000000000000316a389d7f0ac46b19fcbe7076f125566f09cebc"
92+
],
93+
"data": "0x0000000000000000000000000000000000000000000000000000000000009ce10000000000000000000000000000000000000000000000000000048c273950000000000000000000000000000000000000000000000000000000048c27395000",
94+
"blockHash": "0xbc5f23b76034a9090855f4ddf8af02b93c6900a81cd293747272470201aaf6c7",
95+
"blockNumber": "0x9181409",
96+
"transactionHash": "0x7e67e3e199683af23ea7dc5c27cc57f13382a56f0658eea3cc2a9475228fc7fc",
97+
"transactionIndex": "0x3",
98+
"logIndex": "0x8",
99+
"removed": false
100+
}
101+
],
102+
"logsBloom": "0x00000000000000000002000000000000000000000000000000000000000000000010000000000000200000000000000000000000008000000000000000000000000002000000000000000008000000000000000000000000000000000000020000000000020000008200000000000800000000000080001000000010000000000000000000000020000000080000000000000000000000010000000000000000000000008000000000102000000000000000040000400000000440000000000000000002000000000000000080000000000400000000000000000000000020000000040000000000000000000000002000000000008200000000000040000000",
103+
"type": "0x2",
104+
"transactionHash": "0x7e67e3e199683af23ea7dc5c27cc57f13382a56f0658eea3cc2a9475228fc7fc",
105+
"transactionIndex": "0x3",
106+
"blockHash": "0xbc5f23b76034a9090855f4ddf8af02b93c6900a81cd293747272470201aaf6c7",
107+
"blockNumber": "0x9181409",
108+
"gasUsed": "0x3e6d0",
109+
"effectiveGasPrice": "0x5f5e100",
110+
"from": "0x316a389d7f0ac46b19fcbe7076f125566f09cebc",
111+
"to": "0x435e2293653a3e80c93290803faa0d152181b835",
112+
"contractAddress": null,
113+
"gasUsedForL1": "0x1904",
114+
"l1BlockNumber": "0x7ef0ce",
115+
"timeboosted": false
116+
}
117+
],
118+
"libraries": [],
119+
"pending": [],
120+
"returns": {},
121+
"timestamp": 1747154461,
122+
"chain": 421614,
123+
"commit": "0fd43c7"
124+
}

0 commit comments

Comments
 (0)