LogoLogo
  • Introduction
    • What We Do
  • The DeFi Problem
  • How iLayer solves it
  • Use Cases
  • Architecture
    • RFQ
  • Hub & Spoke
    • OrderHub
    • OrderSpoke
  • Router
    • LayerZero Router
    • Axelar Router
    • NullRouter
    • AxLzRouter
  • Solvers
  • Integration
    • Industries
    • EVM Smart contracts
      • Example: cross-chain LPing on Aave
      • Example: cross-chain contract call
  • Audit
Powered by GitBook
On this page
Export as PDF
  1. Integration
  2. EVM Smart contracts

Example: cross-chain contract call

We need to call a dummy contract that exposes the following function

function setValue(uint256 value) external;

We need to craft an order that contains calldata for this specific function, starting from the calldata

bytes4 selector = bytes4(keccak256("setValue(uint256)"));
bytes memory callData = abi.encodePacked(selector, newValue);

then the order itself

{
  sourceChainId: "1", // Ethereum Mainnet
  destinationChainId: "137", // Polygon Pos
  inputs: [
    // WETH
    { tokenType: "FUNGIBLE_TOKEN", tokenAddress: "0x0000000000000000000000004200000000000000000000000000000000000006", tokenId: "0", amount: "10000000" }
  ],
  outputs: [],
  callRecipient: "0x0...", // the contract address
  callData: callData,
  callValue: 0,
}
PreviousExample: cross-chain LPing on AaveNextAudit

Last updated 19 days ago