I am trying to call a script on fuel and pass it some tokens as well. But I am getting this error, even when I don’t have any log in script.
const scriptInstance = new MyScript(wallet);
const tx = await scriptInstance.functions
.main(0)
.callParams({
})
.txParams({
gasLimit: 1000000,
maxFee: 100000,
})
.getTransactionRequest();
const coin = {
amount: 1000000000,
assetId:
"0x000",
};
const coinResponse = await wallet.getCoins(coin.assetId);
tx.addCoinInput(coinResponse.coins[0]);
const chainInfo = await wallet.provider.getChain();
const minGas = tx.calculateMinGas(chainInfo);
const maxGas = tx.calculateMaxGas(chainInfo, minGas);
tx.maxFee = maxGas.mul(1.1);
tx.addContractInputAndOutput(
Address.fromString(
"0x00.."
)
);
const txCost = await wallet.getTransactionCost(tx);
const transactionFee = txCost.maxGas;
tx.gasLimit = transactionFee;
Can someone help me with this issue?