Context (Verify msg.sender)
anyCall V6 is permissionless so you need to verify the msg.sender on the source chain because anyone can call your destination contract.
This context function exists inside the AnyCallExecutor
contract
Returned Information
address from
: The address on the source chain that called anyCall.uint256 fromChainID
: The source chain id.uint256 nonce
: The total amount of times anyCall has been called.
How to import the context interface
An interface should be created to get the context information, it could be the same interface as the interface for anyCall
.
Getting Context and Verify Sender
The address of AnyCallExecutor can be set in constuctor like this
Then context information can be fetched with the following codes and you can use a variable such as verifiedcaller
to verify msg.sender on the source chain is authorized.
Last updated