Skip to content

Commit de19ea5

Browse files
authored
feat: support relayer whitelisting and refactor helper queries into RelayerHelper (#422)
1 parent 7848646 commit de19ea5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1901
-909
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,10 @@ The IBC contracts use `AccessControl` to manage roles and permissions and allow
309309
|:---:|:---:|:---:|:---:|
310310
| `PAUSER_ROLE` | `ICS20Transfer.sol` | Set at initialization. | Can pause the contract. |
311311
| `UNPAUSER_ROLE` | `ICS20Transfer.sol` | Set at initialization. | Can unpause the contract. |
312-
| `RATE_LIMITER_ROLE` | `Escrow.sol` | `address(0)` | Can set withdrawal rate limits per `ERC20` token. |
312+
| `RATE_LIMITER_ROLE` | `Escrow.sol` | `None` | Can set withdrawal rate limits per `ERC20` token. |
313+
| `RELAYER_ROLE` | `ICS26Router.sol` | `None` | Whitelisted relayer addresses. Anyone can relay if `address(0)` has this role. |
314+
| `PORT_CUSTOMIZER_ROLE` | `ICS26Router.sol` | `None` | Can set custom port ids for applications. |
315+
| `CLIENT_ID_CUSTOMIZER_ROLE` | `ICS26Router.sol` | `None` | Can set custom light client ids for applications. |
313316
| `LIGHT_CLIENT_MIGRATOR_ROLE_{client_id}` | `ICS26Router.sol` | Creator of the light client. | Can migrate the light client identified by `client_id`. |
314317
315318
## License

abi/ICS26Router.json

Lines changed: 18 additions & 311 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,19 @@
4343
],
4444
"stateMutability": "view"
4545
},
46+
{
47+
"type": "function",
48+
"name": "RELAYER_ROLE",
49+
"inputs": [],
50+
"outputs": [
51+
{
52+
"name": "",
53+
"type": "bytes32",
54+
"internalType": "bytes32"
55+
}
56+
],
57+
"stateMutability": "view"
58+
},
4659
{
4760
"type": "function",
4861
"name": "UPGRADE_INTERFACE_VERSION",
@@ -430,50 +443,6 @@
430443
],
431444
"stateMutability": "view"
432445
},
433-
{
434-
"type": "function",
435-
"name": "grantClientIdCustomizerRole",
436-
"inputs": [
437-
{
438-
"name": "account",
439-
"type": "address",
440-
"internalType": "address"
441-
}
442-
],
443-
"outputs": [],
444-
"stateMutability": "nonpayable"
445-
},
446-
{
447-
"type": "function",
448-
"name": "grantLightClientMigratorRole",
449-
"inputs": [
450-
{
451-
"name": "clientId",
452-
"type": "string",
453-
"internalType": "string"
454-
},
455-
{
456-
"name": "account",
457-
"type": "address",
458-
"internalType": "address"
459-
}
460-
],
461-
"outputs": [],
462-
"stateMutability": "nonpayable"
463-
},
464-
{
465-
"type": "function",
466-
"name": "grantPortCustomizerRole",
467-
"inputs": [
468-
{
469-
"name": "account",
470-
"type": "address",
471-
"internalType": "address"
472-
}
473-
],
474-
"outputs": [],
475-
"stateMutability": "nonpayable"
476-
},
477446
{
478447
"type": "function",
479448
"name": "grantRole",
@@ -524,11 +493,6 @@
524493
"name": "timelockedAdmin",
525494
"type": "address",
526495
"internalType": "address"
527-
},
528-
{
529-
"name": "customizer",
530-
"type": "address",
531-
"internalType": "address"
532496
}
533497
],
534498
"outputs": [],
@@ -553,152 +517,6 @@
553517
],
554518
"stateMutability": "view"
555519
},
556-
{
557-
"type": "function",
558-
"name": "isPacketReceiveSuccessful",
559-
"inputs": [
560-
{
561-
"name": "packet",
562-
"type": "tuple",
563-
"internalType": "struct IICS26RouterMsgs.Packet",
564-
"components": [
565-
{
566-
"name": "sequence",
567-
"type": "uint64",
568-
"internalType": "uint64"
569-
},
570-
{
571-
"name": "sourceClient",
572-
"type": "string",
573-
"internalType": "string"
574-
},
575-
{
576-
"name": "destClient",
577-
"type": "string",
578-
"internalType": "string"
579-
},
580-
{
581-
"name": "timeoutTimestamp",
582-
"type": "uint64",
583-
"internalType": "uint64"
584-
},
585-
{
586-
"name": "payloads",
587-
"type": "tuple[]",
588-
"internalType": "struct IICS26RouterMsgs.Payload[]",
589-
"components": [
590-
{
591-
"name": "sourcePort",
592-
"type": "string",
593-
"internalType": "string"
594-
},
595-
{
596-
"name": "destPort",
597-
"type": "string",
598-
"internalType": "string"
599-
},
600-
{
601-
"name": "version",
602-
"type": "string",
603-
"internalType": "string"
604-
},
605-
{
606-
"name": "encoding",
607-
"type": "string",
608-
"internalType": "string"
609-
},
610-
{
611-
"name": "value",
612-
"type": "bytes",
613-
"internalType": "bytes"
614-
}
615-
]
616-
}
617-
]
618-
}
619-
],
620-
"outputs": [
621-
{
622-
"name": "",
623-
"type": "bool",
624-
"internalType": "bool"
625-
}
626-
],
627-
"stateMutability": "view"
628-
},
629-
{
630-
"type": "function",
631-
"name": "isPacketReceived",
632-
"inputs": [
633-
{
634-
"name": "packet",
635-
"type": "tuple",
636-
"internalType": "struct IICS26RouterMsgs.Packet",
637-
"components": [
638-
{
639-
"name": "sequence",
640-
"type": "uint64",
641-
"internalType": "uint64"
642-
},
643-
{
644-
"name": "sourceClient",
645-
"type": "string",
646-
"internalType": "string"
647-
},
648-
{
649-
"name": "destClient",
650-
"type": "string",
651-
"internalType": "string"
652-
},
653-
{
654-
"name": "timeoutTimestamp",
655-
"type": "uint64",
656-
"internalType": "uint64"
657-
},
658-
{
659-
"name": "payloads",
660-
"type": "tuple[]",
661-
"internalType": "struct IICS26RouterMsgs.Payload[]",
662-
"components": [
663-
{
664-
"name": "sourcePort",
665-
"type": "string",
666-
"internalType": "string"
667-
},
668-
{
669-
"name": "destPort",
670-
"type": "string",
671-
"internalType": "string"
672-
},
673-
{
674-
"name": "version",
675-
"type": "string",
676-
"internalType": "string"
677-
},
678-
{
679-
"name": "encoding",
680-
"type": "string",
681-
"internalType": "string"
682-
},
683-
{
684-
"name": "value",
685-
"type": "bytes",
686-
"internalType": "bytes"
687-
}
688-
]
689-
}
690-
]
691-
}
692-
],
693-
"outputs": [
694-
{
695-
"name": "",
696-
"type": "bool",
697-
"internalType": "bool"
698-
}
699-
],
700-
"stateMutability": "view"
701-
},
702520
{
703521
"type": "function",
704522
"name": "migrateClient",
@@ -749,78 +567,6 @@
749567
],
750568
"stateMutability": "view"
751569
},
752-
{
753-
"type": "function",
754-
"name": "queryAckCommitment",
755-
"inputs": [
756-
{
757-
"name": "clientId",
758-
"type": "string",
759-
"internalType": "string"
760-
},
761-
{
762-
"name": "sequence",
763-
"type": "uint64",
764-
"internalType": "uint64"
765-
}
766-
],
767-
"outputs": [
768-
{
769-
"name": "",
770-
"type": "bytes32",
771-
"internalType": "bytes32"
772-
}
773-
],
774-
"stateMutability": "view"
775-
},
776-
{
777-
"type": "function",
778-
"name": "queryPacketCommitment",
779-
"inputs": [
780-
{
781-
"name": "clientId",
782-
"type": "string",
783-
"internalType": "string"
784-
},
785-
{
786-
"name": "sequence",
787-
"type": "uint64",
788-
"internalType": "uint64"
789-
}
790-
],
791-
"outputs": [
792-
{
793-
"name": "",
794-
"type": "bytes32",
795-
"internalType": "bytes32"
796-
}
797-
],
798-
"stateMutability": "view"
799-
},
800-
{
801-
"type": "function",
802-
"name": "queryPacketReceipt",
803-
"inputs": [
804-
{
805-
"name": "clientId",
806-
"type": "string",
807-
"internalType": "string"
808-
},
809-
{
810-
"name": "sequence",
811-
"type": "uint64",
812-
"internalType": "uint64"
813-
}
814-
],
815-
"outputs": [
816-
{
817-
"name": "",
818-
"type": "bytes32",
819-
"internalType": "bytes32"
820-
}
821-
],
822-
"stateMutability": "view"
823-
},
824570
{
825571
"type": "function",
826572
"name": "recvPacket",
@@ -935,50 +681,6 @@
935681
"outputs": [],
936682
"stateMutability": "nonpayable"
937683
},
938-
{
939-
"type": "function",
940-
"name": "revokeClientIdCustomizerRole",
941-
"inputs": [
942-
{
943-
"name": "account",
944-
"type": "address",
945-
"internalType": "address"
946-
}
947-
],
948-
"outputs": [],
949-
"stateMutability": "nonpayable"
950-
},
951-
{
952-
"type": "function",
953-
"name": "revokeLightClientMigratorRole",
954-
"inputs": [
955-
{
956-
"name": "clientId",
957-
"type": "string",
958-
"internalType": "string"
959-
},
960-
{
961-
"name": "account",
962-
"type": "address",
963-
"internalType": "address"
964-
}
965-
],
966-
"outputs": [],
967-
"stateMutability": "nonpayable"
968-
},
969-
{
970-
"type": "function",
971-
"name": "revokePortCustomizerRole",
972-
"inputs": [
973-
{
974-
"name": "account",
975-
"type": "address",
976-
"internalType": "address"
977-
}
978-
],
979-
"outputs": [],
980-
"stateMutability": "nonpayable"
981-
},
982684
{
983685
"type": "function",
984686
"name": "revokeRole",
@@ -1847,6 +1549,11 @@
18471549
}
18481550
]
18491551
},
1552+
{
1553+
"type": "error",
1554+
"name": "DefaultAdminRoleCannotBeGranted",
1555+
"inputs": []
1556+
},
18501557
{
18511558
"type": "error",
18521559
"name": "ERC1967InvalidImplementation",

0 commit comments

Comments
 (0)