-1

我试图对已部署的合约进行交叉合约调用,我在调试模式下运行本地 subtrate 节点,并且在尝试执行交叉合约时收到以下消息。

这是错误:

ThreadId(34) runtime::contracts: Execution finished with debug buffer: panicked at 'called `Result::unwrap()` on an `Err` value: CalleeTrapped', erc20/lib.rs:102:14

下面是DeployedContract1交叉调用函数代码:

        #[ink(message)]
        #[ink(selector = 40)]
        pub fn test(&self) -> u32 {
            self.platform_fee
        }

下面是 DeployedContract2 (erc20/lib.rs)函数源代码:

        #[ink(message)]
        pub fn test1(&self,token_contract: AccountId) -> u32 {
            
            let my_return_value: u32 =  ink_env::call::build_call::<<Self as ::ink_lang::reflect::ContractEnv>::Env>()
            .callee(token_contract)
            .gas_limit(50000)
            .transferred_value(0)
            .exec_input(
                ink_env::call::ExecutionInput::new(ink_env::call::Selector::new([0, 0, 0, 40])),
                

            )
            .returns::<ink_env::call::utils::ReturnType<u32>>()
            .fire()
            .unwrap(); <---- Error points to here
            my_return_value
            
        }

4

0 回答 0