Skip to content

Instantly share code, notes, and snippets.

@franciscoaguirre
Created June 13, 2025 16:54
Show Gist options
  • Select an option

  • Save franciscoaguirre/87156bedb9f5879fdb85882ca0becf04 to your computer and use it in GitHub Desktop.

Select an option

Save franciscoaguirre/87156bedb9f5879fdb85882ca0becf04 to your computer and use it in GitHub Desktop.
Contract calling XCM precompile
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
interface IXcm {
struct Weight {
uint64 refTime;
uint64 proofSize;
}
function xcmExecute(bytes calldata message, Weight calldata weight) external;
function xcmSend(bytes calldata destination, bytes calldata message) external;
function weighMessage(bytes calldata message) external view returns (Weight memory weight);
}
contract CallXcmPrecompile {
IXcm internal constant xcmPrecompileAddress = IXcm(0x00000000000000000000000000000000000a0000);
function callXcmExecute() external {
bytes memory message = hex"05040600003000072448657920436973636f";
IXcm.Weight memory weight = IXcm.Weight ({
refTime: 13405128,
proofSize: 0
});
xcmPrecompileAddress.xcmExecute(message, weight);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment