Skip to content

Commit cc78a5c

Browse files
committed
fix: dont allow the router to be allowlisted (C4 QA)
1 parent c74885f commit cc78a5c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

contracts/gateway/L1GraphTokenGateway.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ contract L1GraphTokenGateway is Initializable, GraphTokenGateway, L1ArbitrumMess
111111
function setArbitrumAddresses(address _inbox, address _l1Router) external onlyGovernor {
112112
require(_inbox != address(0), "INVALID_INBOX");
113113
require(_l1Router != address(0), "INVALID_L1_ROUTER");
114+
require(!callhookAllowlist[_l1Router], "ROUTER_CANT_BE_ALLOWLISTED");
114115
require(Address.isContract(_inbox), "INBOX_MUST_BE_CONTRACT");
115116
require(Address.isContract(_l1Router), "ROUTER_MUST_BE_CONTRACT");
116117
inbox = _inbox;
@@ -156,6 +157,7 @@ contract L1GraphTokenGateway is Initializable, GraphTokenGateway, L1ArbitrumMess
156157
*/
157158
function addToCallhookAllowlist(address _newAllowlisted) external onlyGovernor {
158159
require(_newAllowlisted != address(0), "INVALID_ADDRESS");
160+
require(_newAllowlisted != l1Router, "CANT_ALLOW_ROUTER");
159161
require(Address.isContract(_newAllowlisted), "MUST_BE_CONTRACT");
160162
require(!callhookAllowlist[_newAllowlisted], "ALREADY_ALLOWLISTED");
161163
callhookAllowlist[_newAllowlisted] = true;

0 commit comments

Comments
 (0)