fn transfer_nft(
    &self,
    deps: DepsMut,
    env: Env,
    info: MessageInfo,
    recipient: String, // @c4-contest caller of this function can freely specify `recipient` address
    token_id: String,
) -> Result<Response<C>, ContractError> {
    let mut token = self.tokens.load(deps.storage, &token_id)?;
    // ensure we have permissions
    self.check_can_send(deps.as_ref(), &env, &info, &token)?;
    // set owner and remove existing approvals
    let prev_owner = token.owner;
    token.owner = deps.api.addr_validate(&recipient)?; // @c4-contest ownership is transferred to recipient
    token.approvals = vec![];
    let fee_percentage = self.get_fee(deps.storage)?;

    let mut position: i32 = -1;
    let mut amount = Uint128::from(0u64); // @c4-contest: amount is default to zero
    for (i, item) in token.bids.iter().enumerate() {
        if item.address == recipient.to_string()
        {
            position = i as i32;
            amount = item.offer.into();
            break;  
        }
    }
    // @c4-contest: if recipient doesn't have bid on this token, amount is default to zero
    if position != -1 && amount > Uint128::new(0) {
        self.increase_balance(deps.storage, token.sell.denom.clone(), Uint128::new((u128::from(amount) * u128::from(fee_percentage)) / 10000))?;
    }
    let amount_after_fee = amount.checked_sub(Uint128::new((u128::from(amount) * u128::from(fee_percentage)) / 10000)).unwrap_or_default();
    token.bids.retain(|bid| bid.address != recipient);
    self.tokens.save(deps.storage, &token_id, &token)?;
    // @c4-contest: no validation whether the bid amount matches with the listed price.  
    if amount > Uint128::new(0) {
        Ok(Response::new()
        .add_attribute("action", "transfer_nft")
        .add_attribute("sender", info.sender.clone())
        .add_attribute("token_id", token_id)
        .add_message(BankMsg::Send {
            to_address: prev_owner.to_string(),
            amount: vec![Coin {
                denom: token.sell.denom,
                amount: amount_after_fee,
            }],
        }))
    } else { // @c4-contest: if amount is zero, the transfer go through with no payment to seller
        Ok(Response::new()
        .add_attribute("action", "transfer_nft")
        .add_attribute("sender", info.sender.clone())
        .add_attribute("token_id", token_id))
    }
}
if token.sell.isListed {
    if amount < token.sell.price{
        // throw error
    }
    else{
        // proceed to complete the trade
    }
}
else{
    // do normal transfer
}
