Skip to content

Commit fcb4ee0

Browse files
committed
feat: Implement RLCAdapter and RLCOFT contracts with deployment scripts
1 parent 91c7a70 commit fcb4ee0

32 files changed

+2200
-58
lines changed

Makefile

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Makefile for RLC OFT Project
2+
-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
9+
10+
# Default target
11+
help:
12+
@echo "Available commands:"
13+
@echo " make deploy-adapter - Deploy the RLCAdapter contract"
14+
@echo " make deploy-oft - Deploy the RLCOFT contract"
15+
@echo " make verify-adapter - Verify the RLCAdapter contract on Etherscan"
16+
@echo " make verify-oft - Verify the RLCOFT contract on Etherscan"
17+
@echo " make send-tokens - Send tokens cross-chain"
18+
@echo " make estimate-fee - Estimate fee for cross-chain transfer"
19+
@echo " make set-trusted-remote - Set trusted remote for cross-chain communication"
20+
@echo " make set-receive-handler - Set handler for token reception"
21+
@echo " make burn - Burn tokens"
22+
@echo " make test - Run tests"
23+
@echo " make clean - Clean artifacts"
24+
@echo ""
25+
@echo "Usage: make COMMAND [NETWORK=sepolia|arbitrum_sepolia] [ACCOUNT=...] [...]"
26+
27+
# Deployment targets
28+
deploy-adapter:
29+
@echo "Deploying RLCAdapter on $(NETWORK)..."
30+
forge script script/RLCAdapter.s.sol:DeployRLCAdapter \
31+
--rpc-url $(RPC_URL_SEPOLIA) \
32+
--account $(ACCOUNT) \
33+
--broadcast \
34+
-vvv
35+
36+
deploy-oft:
37+
@echo "Deploying RLCOFT on $(NETWORK)..."
38+
forge script script/RLCOFT.s.sol:DeployRLCOFT \
39+
--rpc-url $(RPC_URL_ARBITRUM_SEPOLIA) \
40+
--account $(ACCOUNT) \
41+
--broadcast \
42+
-vvv \
43+
44+
conf-adapter:
45+
@echo "Configuring RLCAdapter on $(NETWORK)..."
46+
forge script script/ConfigureRLCAdapter.s.sol:ConfigureRLCAdapter \
47+
--rpc-url $(RPC_URL_SEPOLIA) \
48+
--account $(ACCOUNT) \
49+
--broadcast \
50+
-vvv
51+
conf-oft:
52+
@echo "Configuring RLCOFT on $(NETWORK)..."
53+
forge script script/ConfigureRLCOFT.s.sol:ConfigureRLCOFT \
54+
--rpc-url $(RPC_URL_ARBITRUM_SEPOLIA) \
55+
--account $(ACCOUNT) \
56+
--broadcast \
57+
-vvv
58+
59+
send-tokens:
60+
@echo "Sending tokens cross-chain..."
61+
forge script script/SendEthereumToArbitrum.s.sol:SendEthereumToArbitrum \
62+
--rpc-url $(RPC_URL_SEPOLIA) \
63+
--account $(ACCOUNT) \
64+
--broadcast \
65+
-vvv

README.md

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ $ anvil
5050
```shell
5151
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
5252
```
53+
forge script script/RLCAdapter.s.sol --rpc-url "https://lb.drpc.org/ogrpc?network=sepolia&dkey=AhEPbH3buE5zjj_dDMs3E2hIUihFGTAR8J88ThukG97E" --broadcast --account iexec-gabriel-mm-dev --verify -vvvv
54+
55+
forge script script/RLCOFT.s.sol --rpc-url "https://lb.drpc.org/ogrpc?network=arbitrum-sepolia&dkey=AhEPbH3buE5zjj_dDMs3E2hIUihFGTAR8J88ThukG97E" --broadcast --account iexec-gabriel-mm-dev --verify -vvvv
5356

5457
### Cast
5558

@@ -64,3 +67,220 @@ $ forge --help
6467
$ anvil --help
6568
$ cast --help
6669
```
70+
71+
72+
forge script script/RLCAdapter.s.sol --rpc-url "https://lb.drpc.org/ogrpc?network=sepolia&dkey=AhEPbH3buE5zjj_dDMs3E2hIUihFGTAR8J88ThukG97E" --broadcast --account iexec-gabriel-mm-dev
73+
Warning: This is a nightly build of Foundry. It is recommended to use the latest stable version. Visit https://book.getfoundry.sh/announcements for more information.
74+
To mute this warning set `FOUNDRY_DISABLE_NIGHTLY_WARNING` in your environment.
75+
76+
[] Compiling...
77+
[] Compiling 62 files with Solc 0.8.25
78+
[] Solc 0.8.25 finished in 1.08s
79+
Compiler run successful!
80+
Enter keystore password:
81+
Script ran successfully.
82+
83+
## Setting up 1 EVM.
84+
85+
==========================
86+
87+
Chain 11155111
88+
89+
Estimated gas price: 0.001000044 gwei
90+
91+
Estimated total gas used for script: 5146876
92+
93+
Estimated amount required: 0.000005147102462544 ETH
94+
95+
==========================
96+
97+
##### sepolia
98+
[Success] Hash: 0x8866979e7ccd74306201da7e3816bfc6ef5788ffe2afd01dc1aeaed488418908
99+
Contract Address: 0x3092c6B927d19B98967913756153Ea86B65774dC
100+
Block: 8290001
101+
Paid: 0.000003959227060128 ETH (3959136 gas * 0.001000023 gwei)
102+
103+
✅ Sequence #1 on sepolia | Total Paid: 0.000003959227060128 ETH (3959136 gas * avg 0.001000023 gwei)
104+
105+
106+
==========================
107+
108+
ONCHAIN EXECUTION COMPLETE & SUCCESSFUL.
109+
110+
Transactions saved to: /Users/gabriel/Documents/iexec/RLC-multichain/broadcast/RLCAdapter.s.sol/11155111/run-latest.json
111+
112+
Sensitive values saved to: /Users/gabriel/Documents/iexec/RLC-multichain/cache/RLCAdapter.s.sol/11155111/run-latest.json
113+
114+
115+
forge script script/RLCOFT.s.sol --rpc-url "https://lb.drpc.org/ogrpc?network=arbitrum-sepolia&dkey=AhEPbH3buE5zjj_dDMs3E2hIUihFGTAR8J88ThukG97E" --broadcast --account iexec-gabriel-mm-dev --verify -vvvv
116+
Warning: This is a nightly build of Foundry. It is recommended to use the latest stable version. Visit https://book.getfoundry.sh/announcements for more information.
117+
To mute this warning set `FOUNDRY_DISABLE_NIGHTLY_WARNING` in your environment.
118+
119+
[] Compiling...
120+
[] Compiling 1 files with Solc 0.8.25
121+
[] Solc 0.8.25 finished in 890.04ms
122+
Compiler run successful!
123+
Enter keystore password:
124+
Traces:
125+
[4402550] DeployRLCOFT::run()
126+
├─ [0] VM::startBroadcast()
127+
│ └─ ← [Return]
128+
├─ [4353607] → new RLCOFT@0x15160ac50442CB2360A3917766e577fFeaE2FD23
129+
│ ├─ emit OwnershipTransferred(previousOwner: 0x0000000000000000000000000000000000000000, newOwner: DefaultSender: [0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38])
130+
│ ├─ [23959] 0x6EDCE65403992e310A62460808c4b910D972f10f::setDelegate(DefaultSender: [0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38])
131+
│ │ ├─ emit DelegateSet(sender: RLCOFT: [0x15160ac50442CB2360A3917766e577fFeaE2FD23], delegate: DefaultSender: [0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38])
132+
│ │ └─ ← [Stop]
133+
│ └─ ← [Return] 21246 bytes of code
134+
├─ [0] VM::stopBroadcast()
135+
│ └─ ← [Return]
136+
└─ ← [Stop]
137+
138+
139+
Script ran successfully.
140+
141+
## Setting up 1 EVM.
142+
==========================
143+
Simulated On-chain Traces:
144+
145+
[4353607] → new RLCOFT@0x15160ac50442CB2360A3917766e577fFeaE2FD23
146+
├─ emit OwnershipTransferred(previousOwner: 0x0000000000000000000000000000000000000000, newOwner: DefaultSender: [0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38])
147+
├─ [23959] 0x6EDCE65403992e310A62460808c4b910D972f10f::setDelegate(DefaultSender: [0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38])
148+
│ ├─ emit DelegateSet(sender: RLCOFT: [0x15160ac50442CB2360A3917766e577fFeaE2FD23], delegate: DefaultSender: [0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38])
149+
│ └─ ← [Stop]
150+
└─ ← [Return] 21246 bytes of code
151+
152+
153+
==========================
154+
155+
Chain 421614
156+
157+
Estimated gas price: 0.200000001 gwei
158+
159+
Estimated total gas used for script: 6260835
160+
161+
Estimated amount required: 0.001252167006260835 ETH
162+
163+
==========================
164+
165+
##### arbitrum-sepolia
166+
[Success] Hash: 0x23eaffd0ded6595787198c9d3fb14645082366c8856642d21d344b3c68056dc5
167+
Contract Address: 0x15160ac50442CB2360A3917766e577fFeaE2FD23
168+
Block: 151160367
169+
Paid: 0.0004776947 ETH (4776947 gas * 0.1 gwei)
170+
171+
✅ Sequence #1 on arbitrum-sepolia | Total Paid: 0.0004776947 ETH (4776947 gas * avg 0.1 gwei)
172+
173+
174+
==========================
175+
176+
ONCHAIN EXECUTION COMPLETE & SUCCESSFUL.
177+
##
178+
Start verification for (1) contracts
179+
Start verifying contract ****`0x15160ac50442CB2360A3917766e577fFeaE2FD23`**** deployed on arbitrum-sepolia
180+
Compiler version: 0.8.25
181+
Constructor args: 000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000006edce65403992e310a62460808c4b910d972f10f0000000000000000000000001804c8ab1f12e6bbf3894d4083f33e07309d1f3800000000000000000000000000000000000000000000000000000000000000146945782e6563204e6574776f726b20546f6b656e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000003524c430000000000000000000000000000000000000000000000000000000000
182+
Attempting to verify on Sourcify, pass the --etherscan-api-key <API_KEY> to verify on Etherscan OR use the --verifier flag to verify on any other provider
183+
184+
Submitting verification for [RLCOFT] "0x15160ac50442CB2360A3917766e577fFeaE2FD23".
185+
Contract successfully verified
186+
All (1) contracts were verified!
187+
188+
Transactions saved to: /Users/gabriel/Documents/iexec/RLC-multichain/broadcast/RLCOFT.s.sol/421614/run-latest.json
189+
190+
Sensitive values saved to: /Users/gabriel/Documents/iexec/RLC-multichain/cache/RLCOFT.s.sol/421614/run-latest.json
191+
192+
193+
194+
195+
RLC => 0x26A738b6D33EF4D94FF084D3552961b8f00639Cd
196+
Sepolia => 0x83784F1233bA5c883F4a74ccB6b71991Cb442192 => adapter
197+
RLCAdapter deployed at: 0x83784F1233bA5c883F4a74ccB6b71991Cb442192
198+
199+
Sepolia ARBITRUM => 0x39BAeafdF85Ec5bBf3D00F7c27F0bc2F8e22ecD2 oft
200+
RLCAdapter deployed at: 0x39BAeafdF85Ec5bBf3D00F7c27F0bc2F8e22ecD2
201+
202+
203+
forge script script/ConfigureRLCAdapter.s.sol --rpc-url "https://lb.drpc.org/ogrpc?network=sepolia&dkey=AhEPbH3buE5zjj_dDMs3E2hIUihFGTAR8J88ThukG97E" --broadcast --account iexec-gabriel-mm-dev
204+
205+
Warning: This is a nightly build of Foundry. It is recommended to use the latest stable version. Visit https://book.getfoundry.sh/announcements for more information.
206+
To mute this warning set `FOUNDRY_DISABLE_NIGHTLY_WARNING` in your environment.
207+
208+
[] Compiling...
209+
[] Compiling 1 files with Solc 0.8.25
210+
[] Solc 0.8.25 finished in 564.63ms
211+
Compiler run successful!
212+
Enter keystore password:
213+
Script ran successfully.
214+
215+
## Setting up 1 EVM.
216+
217+
==========================
218+
219+
Chain 11155111
220+
221+
Estimated gas price: 0.001083598 gwei
222+
223+
Estimated total gas used for script: 66729
224+
225+
Estimated amount required: 0.000000072307410942 ETH
226+
227+
==========================
228+
229+
##### sepolia
230+
[Success] Hash: 0x2168df42fc4cee32cee8868ca1a24ab49f77e4e808fbad196caa0f8864933d60
231+
Block: 8290509
232+
Paid: 0.00000005234641783 ETH (48311 gas * 0.00108353 gwei)
233+
234+
✅ Sequence #1 on sepolia | Total Paid: 0.00000005234641783 ETH (48311 gas * avg 0.00108353 gwei)
235+
236+
237+
==========================
238+
239+
ONCHAIN EXECUTION COMPLETE & SUCCESSFUL.
240+
241+
Transactions saved to: /Users/gabriel/Documents/iexec/RLC-multichain/broadcast/ConfigureRLCAdapter.s.sol/11155111/run-latest.json
242+
243+
Sensitive values saved to: /Users/gabriel/Documents/iexec/RLC-multichain/cache/ConfigureRLCAdapter.s.sol/11155111/run-latest.json
244+
245+
246+
forge script script/ConfigureRLCOFT.s.sol --rpc-url "https://lb.drpc.org/ogrpc?network=arbitrum-sepolia&dkey=AhEPbH3buE5zjj_dDMs3E2hIUihFGTAR8J88ThukG97E" --broadcast --account iexec-gabriel-mm-dev
247+
248+
Warning: This is a nightly build of Foundry. It is recommended to use the latest stable version. Visit https://book.getfoundry.sh/announcements for more information.
249+
To mute this warning set `FOUNDRY_DISABLE_NIGHTLY_WARNING` in your environment.
250+
251+
[] Compiling...
252+
[] Compiling 1 files with Solc 0.8.25
253+
[] Solc 0.8.25 finished in 635.67ms
254+
Compiler run successful!
255+
Enter keystore password:
256+
Script ran successfully.
257+
258+
## Setting up 1 EVM.
259+
260+
==========================
261+
262+
Chain 421614
263+
264+
Estimated gas price: 0.200000001 gwei
265+
266+
Estimated total gas used for script: 63248
267+
268+
Estimated amount required: 0.000012649600063248 ETH
269+
270+
==========================
271+
272+
##### arbitrum-sepolia
273+
[Success] Hash: 0x07b959cbaf66d7333245676857832784396bc32264e5933b9e401342eb2ed36b
274+
Block: 151182502
275+
Paid: 0.0000048267 ETH (48267 gas * 0.1 gwei)
276+
277+
✅ Sequence #1 on arbitrum-sepolia | Total Paid: 0.0000048267 ETH (48267 gas * avg 0.1 gwei)
278+
279+
280+
==========================
281+
282+
ONCHAIN EXECUTION COMPLETE & SUCCESSFUL.
283+
284+
Transactions saved to: /Users/gabriel/Documents/iexec/RLC-multichain/broadcast/ConfigureRLCOFT.s.sol/421614/run-latest.json
285+
286+
Sensitive values saved to: /Users/gabriel/Documents/iexec/RLC-multichain/cache/ConfigureRLCOFT.s.sol/421614/run-latest.json
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"transactions": [
3+
{
4+
"hash": "0x2168df42fc4cee32cee8868ca1a24ab49f77e4e808fbad196caa0f8864933d60",
5+
"transactionType": "CALL",
6+
"contractName": null,
7+
"contractAddress": "0x83784f1233ba5c883f4a74ccb6b71991cb442192",
8+
"function": "setPeer(uint32,bytes32)",
9+
"arguments": [
10+
"40231",
11+
"0x00000000000000000000000039baeafdf85ec5bbf3d00f7c27f0bc2f8e22ecd2"
12+
],
13+
"transaction": {
14+
"from": "0x316a389d7f0ac46b19fcbe7076f125566f09cebc",
15+
"to": "0x83784f1233ba5c883f4a74ccb6b71991cb442192",
16+
"gas": "0x104a9",
17+
"value": "0x0",
18+
"input": "0x3400288b0000000000000000000000000000000000000000000000000000000000009d2700000000000000000000000039baeafdf85ec5bbf3d00f7c27f0bc2f8e22ecd2",
19+
"nonce": "0xa",
20+
"chainId": "0xaa36a7"
21+
},
22+
"additionalContracts": [],
23+
"isFixedGasLimit": false
24+
}
25+
],
26+
"receipts": [
27+
{
28+
"status": "0x1",
29+
"cumulativeGasUsed": "0x2adacbe",
30+
"logs": [
31+
{
32+
"address": "0x83784f1233ba5c883f4a74ccb6b71991cb442192",
33+
"topics": [
34+
"0x238399d427b947898edb290f5ff0f9109849b1c3ba196a42e35f00c50a54b98b"
35+
],
36+
"data": "0x0000000000000000000000000000000000000000000000000000000000009d2700000000000000000000000039baeafdf85ec5bbf3d00f7c27f0bc2f8e22ecd2",
37+
"blockHash": "0xac980e4b020bd4a7ca0e7bf7824e05a22e08c098e622d46cde3d34fbe671159b",
38+
"blockNumber": "0x7e80cd",
39+
"blockTimestamp": "0x681e2554",
40+
"transactionHash": "0x2168df42fc4cee32cee8868ca1a24ab49f77e4e808fbad196caa0f8864933d60",
41+
"transactionIndex": "0x139",
42+
"logIndex": "0x2f0",
43+
"removed": false
44+
}
45+
],
46+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000",
47+
"type": "0x2",
48+
"transactionHash": "0x2168df42fc4cee32cee8868ca1a24ab49f77e4e808fbad196caa0f8864933d60",
49+
"transactionIndex": "0x139",
50+
"blockHash": "0xac980e4b020bd4a7ca0e7bf7824e05a22e08c098e622d46cde3d34fbe671159b",
51+
"blockNumber": "0x7e80cd",
52+
"gasUsed": "0xbcb7",
53+
"effectiveGasPrice": "0x10888a",
54+
"from": "0x316a389d7f0ac46b19fcbe7076f125566f09cebc",
55+
"to": "0x83784f1233ba5c883f4a74ccb6b71991cb442192",
56+
"contractAddress": null
57+
}
58+
],
59+
"libraries": [],
60+
"pending": [],
61+
"returns": {},
62+
"timestamp": 1746806101,
63+
"chain": 11155111,
64+
"commit": "91c7a70"
65+
}

0 commit comments

Comments
 (0)