-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Dear Encode,
public entry fun collect_profits(_: &ShopOwnerCap, shop: &mut CarShop, ctx: &mut TxContext) {
let amount = balance::value(&shop.balance);
let profits = coin::take(&mut shop.balance, amount, ctx);
transfer::transfer(profits, tx_context::sender(ctx))
}
in car_shop.move cause the following error:
Error executing ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("0000000000000000000000000000000000000000000000000000000000000000::car_shop::collect_profits. Invalid call to '0000000000000000000000000000000000000000000000000000000000000002::transfer::transfer' on an object of type '0x2::coin::Coin<0x2::sui::SUI>'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 0000000000000000000000000000000000000000000000000000000000000002::transfer::public_transfer'"), command: None } }
Commenting the code allows it to compile. Im unsure as to what would be the fix as I'm still a beginner!