I’m trying to call a FA2 transfer function from another smart-contract but I’m not sure how to write it in archetype. Here is my code so far
archetype Test(
a_contractToken : address, a_quantity: nat, a_debtor: address, a_creditor: address,
)
record transfer_destination {
to_dest : address;
token_id_dest : nat;
token_amount_dest : nat
} as ((%to_, (token_id, amount)))
record transfer_param {
tp_from : address;
tp_txs : list<transfer_destination>;
} as ((%from_, %txs))
entry exchange() {
const transaction = {
from_ = a_debtor;
txs = [{
to_ = a_creditor;
token_id = 0;
amount = a_quantity
}]
};
transfer 0tz to a_contractToken call %transfer<list<transfer_param>>((transaction))
}
But this doesn’t compile. Thank you for you help !