Open kroist opened 4 months ago
By default the cross contract calls via traits will call into the new call_v2
host function. See https://use.ink/faq/migrating-from-ink-4-to-5/#call-and-instantiate-v2.
The aleph zero node likely does not support the v2
function currently, so you will need to explicitly indicate you want to call the legacy call_v1
method.
You need to do something like the following to call:
let mut psp22: contract_ref!(PSP22) = AccountId::from(token.bytes).into();
let psp22_builder = erc20.call_mut();
psp22_builder
.transfer_from(
AccountId::from(user.bytes),
self.env().account_id(),
amount,
[].to_vec(),
)
.call_v1()
.invoke()
I have a contract with a function
deposit
, which has the following cross-contract calling inside:PSP22
is declared as a trait with#[ink::trait_definition]
I'm running local env of aleph zero node
And when I upload code using
cargo upload
I get:The node logs produce the following error
It works well when I use
CallBuilder