Skip to content

Commit 3ca07ec

Browse files
committed
updated to include callAddress
1 parent fa8b6b4 commit 3ca07ec

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/module/token/crosschain/zetachain.sol

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,18 @@ contract ZetaChainCrossChain is Module {
8585
FALLBACK FUNCTIONS
8686
//////////////////////////////////////////////////////////////*/
8787

88-
function sendMessage(address recipient, address token, uint256 value, bytes memory data) external {
88+
function sendMessage(address callAddress, address recipient, address token, uint256 value, bytes memory data)
89+
external
90+
{
91+
// Mimics the encoding of the ZetaChain client library
92+
// https://github.com/zeta-chain/toolkit/tree/main/packages/client/src
93+
bytes memory encodedData = abi.encodePacked(callAddress, data);
8994
if (token == address(0)) {
90-
(bool success,) = payable(_zetaChainCrossChainStorage().tss).call{value: value}(data);
95+
(bool success,) = payable(_zetaChainCrossChainStorage().tss).call{value: value}(encodedData);
9196
require(success, "Failed to send message");
9297
} else {
9398
IERC20Custody(_zetaChainCrossChainStorage().erc20Custody).deposit(
94-
abi.encode(recipient), IERC20(token), value, data
99+
abi.encode(recipient), IERC20(token), value, encodedData
95100
);
96101
}
97102
}

0 commit comments

Comments
 (0)