Skip to content

Commit

Permalink
Add custom error to CrossChainEnabledPolygonChild (#3380)
Browse files Browse the repository at this point in the history
  • Loading branch information
pcaversaccio committed Apr 29, 2022
1 parent fcf35e5 commit be3cfa0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,7 @@

* `Clones`: optimize clone creation ([#3329](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3329))
* `TimelockController`: Migrate `_call` to `_execute` and allow inheritance and overriding similar to `Governor`. ([#3317](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3317))
* `CrossChainEnabledPolygonChild`: replace the `require` statement with the custom error `NotCrossChainCall`. ([#3380](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3380))

## 4.6.0 (2022-04-26)

Expand Down
Expand Up @@ -63,10 +63,10 @@ abstract contract CrossChainEnabledPolygonChild is IFxMessageProcessor, CrossCha
address rootMessageSender,
bytes calldata data
) external override nonReentrant {
require(msg.sender == _fxChild, "unauthorized cross-chain relay");
if (!_isCrossChain()) revert NotCrossChainCall();

_sender = rootMessageSender;
Address.functionDelegateCall(address(this), data, "crosschain execution failled");
Address.functionDelegateCall(address(this), data, "cross-chain execution failed");
_sender = DEFAULT_SENDER;
}
}

0 comments on commit be3cfa0

Please sign in to comment.