CIS2 transfer doesn't work

I am working on an auction smart contract. I have a create_auction function, and when I try to send CIS2 tokens to the contract, it interrupts the contract execution, tries to call the CIS2 contract and fails without returning an error:
#[receive(contract = “auction”, name = “create_auction”, parameter = “NewAuctionParameter”, enable_logger, mutable)]
pub fn create_auction(
ctx: &impl HasReceiveContext,
host: &mut Host,
logger: &mut impl HasLogger,
) → Result<(), ()> {
let parameter: NewAuctionParameter = ctx.parameter_cursor().get().map_err(|_| ())?;

let owner = match ctx.sender() {
    Address::Account(account_address) => account_address,
    _ => return Err(()), // Only accounts can create auctions
};

// Transfer CIS-2 tokens from the auction creator to the contract
 let transfer = Transfer {
    token_id: parameter.token_id,
    amount: parameter.token_amount,
    from: Address::Account(owner),
    to: Receiver::from_contract(ctx.self_address(), OwnedEntrypointName::new_unchecked("onReceivingCIS2".to_string())),
    data: AdditionalData::empty(),
};

let client = Cis2Client::new(ContractAddress::new(parameter.token_contract.index, parameter.token_contract.subindex));
let result: Result<bool, Cis2ClientError<()>> = client.transfer(host, transfer);
if let Err(err) = &result {
    logger.log(&format!("Transfer failed: {:?}", err)).map_err(|_| ())?;
}

logger.log(&format!("{:?}", result.is_ok())).map_err(|_| ())?;

let auction = Auction {
    auction_state: AuctionState::NotSoldYet,
    highest_bidder: None,
    initial_price: parameter.initial_price,
    highest_bid: Amount::zero(),
    item: parameter.item,
    end: parameter.end,
    owner,
    token_contract: parameter.token_contract,
    token_id: parameter.token_id,
    token_amount: parameter.token_amount,
};

// Add the new auction to the array
let state = host.state_mut();
state.auctions.push(auction);

// Return the ID of the newly created auction
let id = (state.auctions.len() - 1) as u32;
logger.log(&AuctionEvent::Register(AuctionEventData { auction_id: id })).map_err(|_| ())?;
Ok(())

}

Maybe someone has an idea how to check what the error is and how to fix it?
Here is the params.json:
{
“end”: “2025-05-02T12:00:00Z”,
“initial_price”: 10,
“item”: “Item”,
“token_amount”: “1000”,
“token_contract”: {
“index”: 11287,
“subindex”: 0
},
“token_id”: “01”
}

Hey @CryptoSapiens have you seen this one? Implementing CIS-2 token receiving hooks — Concordium documentation sounds like you are missing OnReceivingCIS2 hook in your contract.

And also beware of there is an updateOperator function, it simply enables another address (account or contract) to operate on your behalf. Similar to what approve does in Ethereum ERC20/721 tokens.

I have this one: /// Function to handle receiving CIS-2 tokens.
#[receive(contract = “auction”, name = “onReceivingCIS2”, mutable)]
pub fn on_receiving_cis2(
_ctx: &impl HasReceiveContext,
_host: &mut Host
) → Result<(), ()> {
// This function is intentionally left empty as it serves as a receiver for CIS-2 token transfers.
Ok(())
}