-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbridge polygon zkevm to bnb testnets
1786 lines (1724 loc) · 41.6 KB
/
bridge polygon zkevm to bnb testnets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!-- HTML -->
<script async src="https://cdnjs.cloudflare.com/ajax/libs/web3/1.5.2/web3.min.js"></script>
<script async src="https://cdn.ethers.io/lib/ethers-5.4.umd.min.js"></script>
<div style="margin-top: 10px;">
<!-- Connection Status -->
<p id="statusField" style="font-size: 16px; color: white;">The website is currently loading. Please wait a moment before you can begin using the available functions.</p>
<p id="switchingStatus" style="font-size: 16px; color: white;"></p>
</div>
<div style="margin-top: 20px;">
<!-- Step 1: Connect to BSC Test Net -->
<h2>Step 1: Connect to BSC Test Net</h2>
<p>Click the button below to connect to the BSC Test Net.</p>
<button id="connectBscButton" style="background-color: white; font-size: 30px; color: grey;" onclick="connectToBsc()" disabled>Connect to BSC Test Net</button>
</div>
<script defer>
<!-- Step 1: Connect to BSC Test Net -->
async function connectToBsc() {
const statusField = document.getElementById('statusField');
const connectBscButton = document.getElementById('connectBscButton'); // Get the connectBscButton element
const connectButton = document.getElementById('connectButton'); // Get the connectButton element
try {
// Check the current chain ID
const currentChainId = await ethereum.request({ method: 'eth_chainId' });
console.log('Current chain ID:', currentChainId);
if (currentChainId !== '0x61') {
console.log('Switching to BSC Test Net...');
// Prompt user to switch to the BSC Test Net
await ethereum.request({
method: 'wallet_addEthereumChain',
params: [
{
chainId: '0x61', // BSC Testnet chain ID
chainName: 'BSC Testnet',
nativeCurrency: {
name: 'tBNB',
symbol: 'tBNB',
decimals: 18,
},
rpcUrls: ['https://bsc-testnet.publicnode.com'],
blockExplorerUrls: ['https://testnet.bscscan.com'],
},
],
});
// Check the chain ID again after the user switches networks
const updatedChainId = await ethereum.request({ method: 'eth_chainId' });
if (updatedChainId === '0x61') {
// Network switch successful
console.log('Switched to BSC Test Net.');
statusField.textContent = "Connected to BSC Test Net. You can now proceed to Step 2.";
// Disable connectBscButton and enable connectButton
connectBscButton.disabled = true;
connectBscButton.style.color = 'grey';
connectButton.removeAttribute('disabled');
connectButton.style.color = 'black';
} else {
// Network switch was canceled
console.log('Network switch canceled.');
statusField.textContent = "Network switch canceled. Please refresh the page.";
}
} else {
// Already connected to BSC Test Net
console.log('Already connected to BSC Test Net.');
statusField.textContent = "Connected to BSC Test Net. You can now proceed to Step 2.";
// Disable connectBscButton and enable connectButton
connectBscButton.disabled = true;
connectBscButton.style.color = 'grey';
connectButton.removeAttribute('disabled');
connectButton.style.color = 'black';
}
} catch (error) {
console.error('Error checking or switching network:', error);
showError("An error occurred while checking or switching the network. Please try again.");
}
}
</script>
<div style="margin-top: 20px;">
<!-- Step 2: Connect to MetaMask -->
<h2>Step 2: Connect to MetaMask</h2>
<p>Click the button below to connect your MetaMask wallet.</p>
<button id="connectButton" style="background-color: white; font-size: 30px; color: grey;" onclick="toggleConnection()" disabled>Connect to MetaMask</button>
</div>
<script defer>
<!-- Step 2: Connect to MetaMask -->
async function toggleConnection() {
if (typeof window.ethereum !== 'undefined') {
try {
const accounts = await ethereum.request({ method: 'eth_accounts' });
if (accounts.length === 0) {
console.log('Connecting to MetaMask...');
const connectedAccounts = await ethereum.request({ method: 'eth_requestAccounts' });
const userAddress = connectedAccounts[0]; // Get user address from connected accounts
console.log('Connected to MetaMask. User Address:', userAddress);
document.getElementById('statusField').textContent = 'Connected to MetaMask. User Address: ' + userAddress + '. Proceed to step 3.';
document.getElementById('connectButton').style.color = 'grey'; // Set font text color to grey
document.getElementById('connectButton').disabled = true;
// Enable and style approveButton
const approveButton = document.getElementById('approveButton');
approveButton.removeAttribute('disabled');
approveButton.style.color = 'black'; // Set font text color to black
} else {
const userAddress = accounts[0]; // Get user address from existing accounts
console.log('Already connected to MetaMask. User Address:', userAddress);
document.getElementById('statusField').textContent = 'Connected to MetaMask. User Address: ' + userAddress + '. Proceed to step 3.';
document.getElementById('connectButton').style.color = 'grey'; // Set font text color to grey
document.getElementById('connectButton').disabled = true;
// Enable and style approveButton
const approveButton = document.getElementById('approveButton');
approveButton.removeAttribute('disabled');
approveButton.style.color = 'black'; // Set font text color to black
}
} catch (error) {
console.error('Error connecting to MetaMask:', error);
const errorMessage = getErrorMessage(error);
document.getElementById('statusField').textContent = 'Error: ' + errorMessage;
}
} else {
showError('MetaMask is not available. Please install MetaMask.');
}
}
function getErrorMessage(error) {
if (error.code === 4001) {
return 'User rejected the connection request.';
}
return 'An unknown error occurred. Please try again.';
}
</script>
<div style="margin-top: 20px;">
<!-- Step 3: Approve Spend -->
<h2>Step 3: Approve Spend</h2>
<p>In this step, we need to tell the Lotus Capital Hub token contract that we allow the bridge contract to spend tokens. You should only approve the amount of tokens you wish to transfer via the bridge contract. Please note that this spend approval is permanent, so we recommend adjusting the spend after you successfully transfer the tokens via the bridge contract.</p>
<p>Here's what you need to know:</p>
<ul>
<li>This spend approval is permanent and allows the bridge contract to spend the approved amount of tokens.</li>
<li>If you want to send a specific amount of tokens, enter that amount in the input field.</li>
<li>If you wish to increase the approved amount, repeat this step and enter the new amount.</li>
<li>If you want to lower the approved amount, repeat this step and enter the new, lower amount.</li>
<li>Once you have successfully transferred the tokens via the bridge contract to Polygon, you can redo this step and set the value to 0 to remove the bridge contract's ability to spend your tokens.</li>
</ul>
<form onsubmit="approveSpend(); return false;">
<label for="tokenAmountInput">Enter the amount of tokens to spend:</label>
<input type="text" id="tokenAmountInput" style="font-size: 16px; width: 180px;" placeholder="Enter amount" required pattern="[0-9]+">
<p style="font-size: 12px; color: red;">Please enter a whole number with no decimals or special characters. This may cause the transaction to fail or another unforeseen error.</p>
<input type="checkbox" id="securityCheckbox" required>
<label for="securityCheckbox">I understand that I take full responsibility for using this function and understand Lotus Capital Hub is not responsible for anything resulting from my use of this function.</label><br>
<button type="submit" id="approveButton" style="background-color: white; font-size: 30px; color: grey;" disabled>Approve Spend</button>
</form>
</div>
<script>
<!-- Step 3: Approve Spend -->
async function approveSpend() {
try {
if (typeof window.ethereum === 'undefined') {
throw new Error('MetaMask is not available. Please install MetaMask.');
}
const contractAddress = '0x552f9B7EB8951C138d5B23C785A405C1602A9589';
const contractAbi = [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "subtractedValue",
"type": "uint256"
}
],
"name": "decreaseAllowance",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "addedValue",
"type": "uint256"
}
],
"name": "increaseAllowance",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
];
const web3 = new Web3(window.ethereum);
const contract = new web3.eth.Contract(contractAbi, contractAddress);
const accounts = await ethereum.request({ method: 'eth_requestAccounts' });
const userAddress = accounts[0];
const spender = '0xA1894b6d732B898dD44382f352aF0Ccc75CfAA58';
const amount = document.getElementById('tokenAmountInput').value+'000000000000000000';
const gasAmount = 50000;
const transaction = await contract.methods.approve(spender, amount).send({ from: userAddress, gas: gasAmount });
console.log('Transaction success receipt:', transaction);
// Transaction was successful, you can update the UI or show a success message here
document.getElementById('sendFromButton').removeAttribute('disabled');
sendFromButton.style.color = 'black';
statusField.textContent = "Approval was successful. Please proceed to step 4.";
// Transaction was successful, you can update the UI or show a success message here
} catch (error) {
console.error('Transaction error:', error);
showError('Transaction error. Please try again.');
}
}
</script>
<div style="margin-top: 20px;">
<!-- Step 4: Complete SendFrom Function-->
<h2>Step 4: Complete token transfer from BNB Chain Test Net to Polygon zkEVM Test Net</h2>
<p>Now it's time to send the tokens from your wallet on BNB Chain Test Net to the exact same wallet address on Polygon zkEVM Test Net. To complete this step, enter the desired token amount to transfer in the input field. Please note that you should only send the exact amount of tokens you approved in Step 3 or less, or the transaction will fail. The input field only accepts numbers, and no other form of characters.</p>
<p>We have set a fixed gas amount based on our experience of using the transfer, however, we cannot predict fluctuations in the blockchain and the estimates may be wrong or fail due to any other related reason, which is out of our control. You understand clearly on this point. Gas is used by the blockchain, and unused gas will be refunded back to your wallet. You can adjust the gas fees in MetaMask according to your own discretion.</p>
<p>Lotus Capital Hub has implemented the standard contract v2 presented by Layer Zero Labs and does not profit in any form from you conducting this transaction on the blockchain. In fact, the costs associated with using Layer Zero Labs may be far cheaper than other typical bridges. Layer Zero Labs processes the transaction and may take a percentage of the transaction fees to process your transaction.</p>
<p>If you need any support with the front end of Lotus Capital Hub, please contact us. However, if you have an issue with your transfer that is marked as successful by Layer Zero Labs, please go to the official Layer Zero Labs Discord server and open a ticket with them.</p>
<form onsubmit="sendFromA(); return false;">
<label for="tokenAmountInput">Enter the amount of tokens to transfer:</label>
<input type="number" id="tokenAmountInputSend" style="font-size: 16px; width: 180px;" placeholder="Enter amount" required min="0" max="approvedAmount">
<p style="font-size: 12px; color: red;">Please enter a whole number with no decimals or special characters. This may cause the transaction to fail or another unforeseen error.</p>
<input type="checkbox" id="securityCheckbox" required>
<label for="securityCheckbox">I understand that I take full responsibility for using this function and understand Lotus Capital Hub is not responsible for anything resulting from my use of this function.</label><br>
<button type="submit" id="sendFromButton" style="background-color: white; font-size: 30px; color: grey;">Complete sendFrom</button>
</form>
</div>
<script>
<!-- Step 4: Complete SendFrom Function-->
async function sendFromA() {
try {
if (typeof window.ethereum === 'undefined') {
throw new Error('MetaMask is not available. Please install MetaMask.');
}
const contractAddress = '0xA1894b6d732B898dD44382f352aF0Ccc75CfAA58';
const contractAbi = [
{
"inputs": [
{
"internalType": "address",
"name": "_token",
"type": "address"
},
{
"internalType": "uint8",
"name": "_sharedDecimals",
"type": "uint8"
},
{
"internalType": "address",
"name": "_lzEndpoint",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"indexed": false,
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"indexed": false,
"internalType": "bytes32",
"name": "_hash",
"type": "bytes32"
}
],
"name": "CallOFTReceivedSuccess",
"type": "event"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"internalType": "bytes32",
"name": "_from",
"type": "bytes32"
},
{
"internalType": "address",
"name": "_to",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
},
{
"internalType": "uint256",
"name": "_gasForCall",
"type": "uint256"
}
],
"name": "callOnOFTReceived",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "forceResumeReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "lzReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"indexed": false,
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_reason",
"type": "bytes"
}
],
"name": "MessageFailed",
"type": "event"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "nonblockingLzReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "_address",
"type": "address"
}
],
"name": "NonContractAddress",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"indexed": true,
"internalType": "address",
"name": "_to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "ReceiveFromChain",
"type": "event"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "retryMessage",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"indexed": false,
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"indexed": false,
"internalType": "bytes32",
"name": "_payloadHash",
"type": "bytes32"
}
],
"name": "RetryMessageSuccess",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "_from",
"type": "address"
},
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "bytes32",
"name": "_toAddress",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "_dstGasForCall",
"type": "uint64"
},
{
"components": [
{
"internalType": "address payable",
"name": "refundAddress",
"type": "address"
},
{
"internalType": "address",
"name": "zroPaymentAddress",
"type": "address"
},
{
"internalType": "bytes",
"name": "adapterParams",
"type": "bytes"
}
],
"internalType": "struct ICommonOFT.LzCallParams",
"name": "_callParams",
"type": "tuple"
}
],
"name": "sendAndCall",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_from",
"type": "address"
},
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "bytes32",
"name": "_toAddress",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
},
{
"components": [
{
"internalType": "address payable",
"name": "refundAddress",
"type": "address"
},
{
"internalType": "address",
"name": "zroPaymentAddress",
"type": "address"
},
{
"internalType": "bytes",
"name": "adapterParams",
"type": "bytes"
}
],
"internalType": "struct ICommonOFT.LzCallParams",
"name": "_callParams",
"type": "tuple"
}
],
"name": "sendFrom",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"indexed": true,
"internalType": "address",
"name": "_from",
"type": "address"
},
{
"indexed": true,
"internalType": "bytes32",
"name": "_toAddress",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "SendToChain",
"type": "event"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
},
{