Hi Friends! Here is a simple contract which holds a list of wallets to whom money (custom coin) should be spread and two entry functions. One adds given wallet to the list, another mints and sends money to all people in the list.
With this second function I got error:
Error calling module: Failure {
error: "MovePrimitiveRuntimeError(Some(MoveLocation { module: ModuleId { address: 0000000000000000000000000000000000000002, name: Identifier(\"tx_context\") }, function: 4, instruction: 0, function_name: Some(\"derive_id\") }))",
}
Any advice on this, please? What may I be missing here? Also I noticed that gas is still wasted despite transaction failed - is this expected behavior? P.S. the custom coin is defined in different module but that one is almost a copy of coin.move
example from github repo, just with additional function to expose treasury
for use in other functions.
UPD: most of code was removed as the mistake is extremely silly
while (i < n) {
let rec = vector::borrow(& mgr.records, i);
let c = coin::mint(mytoken::treasury(adm), rec.due, ctx);
transfer::transfer(c, rec.wallet)
}