Ethereum
Here Are the Few core Function of the bridge
function swapAndBridge(
uint256 sourceChainId,
address addr,
uint256 amount,
address tokenAddress,
uint256 nonce,
uint256 destinationChainId
) public returns (bytes32) {
bytes32 message = hashMessage(sourceChainId, addr, amount, tokenAddress, nonce, destinationChainId);
messenger.sendMessage(message);
//Before calling this function, the user must approve the contract to spend their tokens
IERC20(tokenAddress).transferFrom(msg.sender, address(this), amount);
return message;
}TOKEN RECEPTION HANDLER-
VALIDATOR SIGNATURE VERIFICATION-
Last updated