I'm trying to make cross contracts calls on already deployed contract, I'm running the local subtrate node in debug mode, and I'm getting the following message when trying to preform cross contracts.
Here is the error:
ThreadId(34) runtime::contracts: Execution finished with debug buffer: panicked at 'called `Result::unwrap()` on an `Err` value: CalleeTrapped', erc20/lib.rs:102:14
Here is the DeployedContract1
cross call function code:
#[ink(message)]
#[ink(selector = 40)]
pub fn test(&self) -> u32 {
self.platform_fee
}
Here is the DeployedContract2 (erc20/lib.rs)
function source code:
#[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) <--- ERROR points here
.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();
my_return_value
}