Could we add a crossChainContextCall?
hope2028 opened this issue · comments
Hope2028 commented
anyswap-v1-core/contracts/AnyswapV4CallProxy.sol
Lines 54 to 56 in 34d191d
Thanks for creating this method for us, it's very useful for us. And we also hope we can add a crosschainContextCall
method. As sometimes, we need to pass the trust from one contract to another contract, like contract a trust contract b. And this may happen between chains. Contract a is on chain a', and contract b is on chain b'. Therefore, could we add a crossChainContextCall
like the following pseudo code.
function crossChainContextCall(address memory to, bytes memory param, address memory callback, uint memory nonce, uint toChainID) external {
bytes[] memory data = encodeContextCall(param);
emit LogAnyCall(msg.sender, to, data, callbacks, nonces, cID(), toChainID);
}
function encodeContextCall(bytes param) external pure returns (bytes memory) {
return abi.encodeWithSignature("contextCall(address,address,bytes)", tx.origin, msg.sender, param);
}