Request form
Cookbook may introduce a token in the future. Share and contribute to be eligible for future airdrops.
close icon
relevant tag icon
Call Contract Example
copy icon
Axelar
• version 1.0.0
crosschain
relay
call

Call Contract Example

This example demonstrates how to relay a message from a source-chain to a destination-chain. Check out the repo for more info: https://github.com/axelarnetwork/axelar-examples/tree/main/examples/evm/call-contract

*Visit desktop site to download or deploy

Version

1.0.0

Creator

Axelar

Last Publish

2/28/2023
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
setRemoteValue(string,string,string) :
This function is used to set a remote value on a different blockchain. It takes three parameters: the destination chain, the destination address, and the value to be set. The function first encodes the value into a byte array, and then checks if the msg.value is greater than 0. If it is, it pays the native gas for the contract call using the gasService.payNativeGasForContractCall function. Finally, it calls the gateway.callContract function with the destination chain, destination address, and payload as parameters. This will set the remote value on the destination chain. (autogenerated documentation)
_execute(string,string) :
This function is an internal override of the _execute() function in the CrossChainBase contract. It decodes the payload data passed to it and stores the source chain and source address in the sourceChain and sourceAddress variables respectively. (autogenerated documentation)

Get Cookin'
share iconShare

copy iconDownload Source
copy iconnpx cookbookdev i Call-Contract-Example
copy icon

Last Publish

2/28/2023

Version

1.0.0

Creator

Axelar

Cookbook is free.
Any contract you deploy is yours.
Your contract is owned and controlled by you.