# Issue with with\_contracts function

**URL:** <https://forum.fuel.network/t/issue-with-with-contracts-function/6365>\
**Category:** Rust SDK\
**Created:** [July 29, 2024, 3:11am UTC](https://forum.fuel.network/t/issue-with-with-contracts-function/6365 "2024-07-29T03:11:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![xpluscal](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/xpluscal/32/3337_2.png) [@xpluscal](https://forum.fuel.network/u/xpluscal)\
**Post date:** [July 29, 2024, 3:11am UTC](https://forum.fuel.network/t/issue-with-with-contracts-function/6365/1 "2024-07-29T03:11:55Z")

</div>

I have a contract calling another contract. Now even though I did set the “with\_contracts” with an instance, I do get “ContractNotInInputs” error.

Here’s the test interface function:

```auto
pub(crate) async fn mint(
    contract: &SRC721Edition<WalletUnlocked>,
    recipient: Identity,
    sub_id: Bits256,
    amount: u64,
    price: u64,
    fee_contract_instance: &OctaneFeeSplitter<WalletUnlocked>,
) -> FuelCallResponse<()> {
    contract
        .methods()
        .mint(recipient, sub_id, amount)
        .with_contracts(&[fee_contract_instance])
        .append_variable_outputs(1)
        .call_params(CallParameters::new(price, AssetId::zeroed(), 1_000_000))
        .unwrap()
        .call()
        .await
        .unwrap()
}

```

Here’s a sample test:

```auto
#[tokio::test]
    async fn mints_assets_with_fees() {
        let (owner_wallet, other_wallet, id, instance_1, _instance_2, _fee_id, fee_instance_1) = setup().await;
        let (
            asset_id_1,
            _asset_id_2,
            _asset_id_3,
            sub_id_1,
            _sub_id_2,
            _sub_id_3,
            owner_identity,
            other_identity,
        ) = defaults(id, owner_wallet, other_wallet.clone());

        constructor(&instance_1, owner_identity, default_name(), default_symbol(), default_metadata_keys(), default_metadata_values(), default_price()).await;

        assert_eq!(get_wallet_balance(&other_wallet, &asset_id_1).await, 0);
        assert_eq!(total_supply(&instance_1, asset_id_1).await, None);
        assert_eq!(total_assets(&instance_1).await, 0);

        let fee_amount = 1_000;
        set_fee(&fee_instance_1, fee_amount).await;
        assert_eq!(fee(&fee_instance_1).await, Some(fee_amount));

        mint(&instance_1, other_identity, sub_id_1, 1, 1_000, &fee_instance_1).await;

        assert_eq!(get_wallet_balance(&other_wallet, &asset_id_1).await, 1);
        assert_eq!(total_supply(&instance_1, asset_id_1).await, Some(1));
        assert_eq!(total_assets(&instance_1).await, 1);
    }

```

And here’s the setup:

```auto
pub(crate) async fn setup() -> (
    WalletUnlocked,
    WalletUnlocked,
    ContractId,
    SRC721Edition<WalletUnlocked>,
    SRC721Edition<WalletUnlocked>,
    ContractId,
    OctaneFeeSplitter<WalletUnlocked>,
) {
    let number_of_coins = 1;
    let coin_amount = 100_000_000;
    let number_of_wallets = 2;

    let base_asset = AssetConfig {
        id: AssetId::zeroed(),
        num_coins: number_of_coins,
        coin_amount,
    };
    let assets = vec![base_asset];

    let wallet_config = WalletsConfig::new_multiple_assets(number_of_wallets, assets);
    let mut wallets = launch_custom_provider_and_get_wallets(wallet_config, None, None)
        .await
        .unwrap();

    let wallet1 = wallets.pop().unwrap();
    let wallet2 = wallets.pop().unwrap();

    let id = Contract::load_from(NFT_CONTRACT_BINARY_PATH, LoadConfiguration::default())
        .unwrap()
        .deploy(&wallet1, TxPolicies::default())
        .await
        .unwrap();

    let instance_1 = SRC721Edition::new(id.clone(), wallet1.clone());
    let instance_2 = SRC721Edition::new(id.clone(), wallet2.clone());

    let fee_id = Contract::load_from(FEE_SPLITTER_CONTRACT_BINARY_PATH, LoadConfiguration::default())
        .unwrap()
        .deploy(&wallet1, TxPolicies::default())
        .await
        .unwrap();

    let fee_instance_1 = OctaneFeeSplitter::new(id.clone(), wallet1.clone());

    (wallet1, wallet2, id.into(), instance_1, instance_2, fee_id.into(), fee_instance_1)
}

```

Any help appreciated.

---

<div class="post-metadata">

**Author:** ![xpluscal](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/xpluscal/32/3337_2.png) [@xpluscal](https://forum.fuel.network/u/xpluscal)\
**Post date:** [July 29, 2024, 3:30am UTC](https://forum.fuel.network/t/issue-with-with-contracts-function/6365/2 "2024-07-29T03:30:59Z")

</div>

Follow up: Doing the same with the contract id aka `.with_contract_ids` works just fine.

---

<div class="post-metadata">

**Author:** ![nick](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/nick/32/2330_2.png) [@nick](https://forum.fuel.network/u/nick)\
**Post date:** [July 29, 2024, 6:42am UTC](https://forum.fuel.network/t/issue-with-with-contracts-function/6365/3 "2024-07-29T06:42:50Z")

</div>

Hi @xpluscal ,

I’ll have the Rust team take a look at this and get back to you shortly.

---

<div class="post-metadata">

**Author:** ![xpluscal](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/xpluscal/32/3337_2.png) [@xpluscal](https://forum.fuel.network/u/xpluscal)\
**Post date:** [July 31, 2024, 4:06am UTC](https://forum.fuel.network/t/issue-with-with-contracts-function/6365/4 "2024-07-31T04:06:38Z")

</div>

Great, thank you @nick

---

<div class="post-metadata">

**Author:** ![hal3e](https://avatars.discourse-cdn.com/v4/letter/h/958977/32.png) [@hal3e](https://forum.fuel.network/u/hal3e)\
**Post date:** [August 6, 2024, 7:28am UTC](https://forum.fuel.network/t/issue-with-with-contracts-function/6365/5 "2024-08-06T07:28:02Z")

</div>

@xpluscal can you paste here the version with `with_contract_ids` that works please ?
