Hi all,
I’m writing a func to deposit coin and use the split func to process it as code below:
public fun deposit(
pool: &mut Pool,
coin: Coin<SUI>,
ctx: &mut TxContext
) {
let sender = tx_context::sender(ctx);
let dep_coin = coin::split(&mut coin, pool.amount, ctx);
transfer::transfer(dep_coin, pool.pooler);
}
but got The parameter 'coin' still contains a value
please give me advise to fix it.