Keep getting this error while making fun call of smart contracts and providing the contracts to the dependency array
Error message
InputContractAssociatedOutputContract { index: 5 }: {"response":{"data":null,"errors":[{"message":"InputContractAssociatedOutputContract { index: 5 }","locations":[{"line":2,"column":3}],"path":["dryRun"]}],"status":200,"headers":{}},"request":{"query":"mutation dryRun($encodedTransaction: HexString!, $utxoValidation: Boolean) {\n dryRun(tx: $encodedTransaction, utxoValidation: $utxoValidation) {\n ...receiptFragment\n }\n}\n\nfragment receiptFragment on Receipt {\n contract {\n id\n bytecode\n salt\n }\n pc\n is\n to {\n id\n bytecode\n salt\n }\n toAddress\n amount\n assetId\n gas\n param1\n param2\n val\n ptr\n digest\n reason\n ra\n rb\n rc\n rd\n len\n receiptType\n result\n gasUsed\n data\n sender\n recipient\n nonce\n contractId\n subId\n}","variables": ...
Here is func call
await account.contracts?.vaultContract.functions.withdraw_collateral(freeCollBeforeWithdraw.toString(), parsedUpdateData)
.addContracts([
account.contracts?.pythContract,
account.contracts?.clearingHouseContract,
account.contracts?.accountBalanceContract,
account.contracts?.proxyContract,
account.contracts?.vaultContract,
])
.callParams({
forward: {amount: pythFee, assetId: TOKENS_BY_SYMBOL.ETH.assetId}, //1 for one token
})
.txParams({gasPrice: 1})
.call();
So I was told that order of those contracts can be wrong and I should use getTransactionRequest fn to find out correct inputs orders . So I did it.
But anyway it fails
const scope = account.contracts?.vaultContract.functions.withdraw_collateral(freeCollBeforeWithdraw.toString(), parsedUpdateData)
.addContracts([
account.contracts?.pythContract,
account.contracts?.clearingHouseContract,
account.contracts?.accountBalanceContract,
account.contracts?.proxyContract,
account.contracts?.vaultContract,
])
.callParams({
forward: {amount: pythFee, assetId: TOKENS_BY_SYMBOL.ETH.assetId}, //1 for one token
})
.txParams({gasPrice: 1})
const request = await scope.getTransactionRequest()
console.log("request", request)