diff --git a/chain-extensions/types/xvm/src/lib.rs b/chain-extensions/types/xvm/src/lib.rs index 014c1bcbb1..a003b74726 100644 --- a/chain-extensions/types/xvm/src/lib.rs +++ b/chain-extensions/types/xvm/src/lib.rs @@ -18,7 +18,7 @@ #![cfg_attr(not(feature = "std"), no_std)] -use astar_primitives::xvm::CallError; +use astar_primitives::{xvm::CallError, Balance}; use parity_scale_codec::{Decode, Encode}; use sp_std::vec::Vec; @@ -66,5 +66,5 @@ pub struct XvmCallArgs { /// Encoded call params pub input: Vec, /// Value to transfer - pub value: u128, + pub value: Balance, } diff --git a/precompiles/xvm/evm_sdk/XVM.sol b/precompiles/xvm/evm_sdk/XVM.sol index 652582ff08..6757a92ddf 100644 --- a/precompiles/xvm/evm_sdk/XVM.sol +++ b/precompiles/xvm/evm_sdk/XVM.sol @@ -6,15 +6,17 @@ pragma solidity ^0.8.0; interface XVM { /** * @dev Execute external VM call - * @param context - execution context - * @param to - call recepient + * @param vm_id - target VM id + * @param to - call recipient * @param input - SCALE-encoded call arguments + * @param value - value to transfer * @return success - operation outcome * @return data - output data if successful, error data on error */ function xvm_call( - bytes calldata context, + uint8 calldata vm_id, bytes calldata to, bytes calldata input + uint256 value ) external returns (bool success, bytes memory data); } diff --git a/precompiles/xvm/evm_sdk/flipper.sol b/precompiles/xvm/evm_sdk/flipper.sol index fcbfdd3d40..724fc419df 100644 --- a/precompiles/xvm/evm_sdk/flipper.sol +++ b/precompiles/xvm/evm_sdk/flipper.sol @@ -5,6 +5,7 @@ interface XVM { uint8 calldata vm_id, bytes calldata to, bytes calldata input, + uint256 calldata value, ) external; } @@ -13,6 +14,6 @@ library Flipper { function flip(bytes to) { bytes input = "0xcafecafe"; - XVM_PRECOMPILE.xvm_call(0x1F, to, input); + XVM_PRECOMPILE.xvm_call(0x1F, to, input, 1000000); } }