Created
June 13, 2025 16:54
-
-
Save franciscoaguirre/87156bedb9f5879fdb85882ca0becf04 to your computer and use it in GitHub Desktop.
Contract calling XCM precompile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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