Skip to content

Commit

Permalink
fix: add proxyPool whitelist to onlyOffRamp modifier
Browse files Browse the repository at this point in the history
DhairyaSethi committed Oct 22, 2024
1 parent 7ae1477 commit 47a535b
Showing 2 changed files with 16 additions and 3 deletions.
4 changes: 3 additions & 1 deletion contracts/src/v0.8/ccip/pools/GHO/UpgradeableTokenPool.sol
Original file line number Diff line number Diff line change
@@ -269,7 +269,9 @@ abstract contract UpgradeableTokenPool is IPool, OwnerIsCreator, IERC165 {
/// is a permissioned offRamp for the given chain on the Router.
modifier onlyOffRamp(uint64 remoteChainSelector) {
if (!isSupportedChain(remoteChainSelector)) revert ChainNotAllowed(remoteChainSelector);
if (!s_router.isOffRamp(remoteChainSelector, msg.sender)) revert CallerIsNotARampOnRouter(msg.sender);
if (!(msg.sender == getProxyPool() || s_router.isOffRamp(remoteChainSelector, msg.sender))) {
revert CallerIsNotARampOnRouter(msg.sender);
}
_;
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
```diff
diff --git a/src/v0.8/ccip/pools/TokenPool.sol b/src/v0.8/ccip/pools/GHO/UpgradeableTokenPool.sol
index b3571bb449..aa86725ef6 100644
index b3571bb449..7cae344a2e 100644
--- a/src/v0.8/ccip/pools/TokenPool.sol
+++ b/src/v0.8/ccip/pools/GHO/UpgradeableTokenPool.sol
@@ -1,21 +1,24 @@
@@ -94,7 +94,18 @@ index b3571bb449..aa86725ef6 100644
_;
}

@@ -323,4 +328,21 @@ abstract contract TokenPool is IPool, OwnerIsCreator, IERC165 {
@@ -264,7 +269,9 @@ abstract contract TokenPool is IPool, OwnerIsCreator, IERC165 {
/// is a permissioned offRamp for the given chain on the Router.
modifier onlyOffRamp(uint64 remoteChainSelector) {
if (!isSupportedChain(remoteChainSelector)) revert ChainNotAllowed(remoteChainSelector);
- if (!s_router.isOffRamp(remoteChainSelector, msg.sender)) revert CallerIsNotARampOnRouter(msg.sender);
+ if (!(msg.sender == getProxyPool() || s_router.isOffRamp(remoteChainSelector, msg.sender))) {
+ revert CallerIsNotARampOnRouter(msg.sender);
+ }
_;
}

@@ -323,4 +330,21 @@ abstract contract TokenPool is IPool, OwnerIsCreator, IERC165 {
if (IARM(i_armProxy).isCursed()) revert BadARMSignal();
_;
}

0 comments on commit 47a535b

Please sign in to comment.