Skip to content

Commit

Permalink
fix: do not try to increment nonce in view function
Browse files Browse the repository at this point in the history
  • Loading branch information
junkim012 committed Jan 14, 2025
1 parent d2ab256 commit b2e5c42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ contract MultiChainHyperlaneTellerWithMultiAssetSupport is MultiChainTellerBase
* @param data Bridge data
*/
function _quote(uint256 shareAmount, BridgeData calldata data) internal view override returns (uint256) {
bytes32 messageId = keccak256(abi.encodePacked(++nonce, address(this), block.chainid));
uint256 nextNonce = nonce + 1;
bytes32 messageId = keccak256(abi.encodePacked(nextNonce, address(this), block.chainid));

bytes memory _payload = abi.encode(shareAmount, data.destinationChainReceiver, messageId);

Expand Down
2 changes: 1 addition & 1 deletion src/base/Roles/CrossChain/MultiChainTellerBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ abstract contract MultiChainTellerBase is CrossChainTellerBase {
* @param data bridge data
*/
function _beforeBridge(BridgeData calldata data) internal override {
Chain chain = selectorToChains[data.chainSelector];
Chain memory chain = selectorToChains[data.chainSelector];

if (!chain.allowMessagesTo) {
revert MultiChainTellerBase_MessagesNotAllowedTo(data.chainSelector);
Expand Down

0 comments on commit b2e5c42

Please sign in to comment.