I'm trying to call a message on my ink! v3 smart contract using the polkadot-js ContractPromise
but I'm getting the error:
system.ExtrinsicFailed::ExtrinsicFailed:: contracts.OutOfGas
This is how I'm making the call:
const eventList: EventList[] = [];
const pr = new Promise((res, rej) => {
// Dry run the call
contract.query
.initiateVerficationFlow(address, {})
.then((value) => {
// create weightV2 type by calling registry.createType, similar to https://github.com/paritytech/contracts-ui/blob/master/src/helpers/callOptions.ts#L42
const gasLimit = getGasLimit(
value.gasRequired.refTime.toBn(),
value.gasRequired.proofSize.toBn(),
contract.registry
);
// Make the call, and listen to events
contract.tx
.initiateVerficationFlow({
storageDepositLimit: value.storageDeposit.asCharge,
gasLimit: gasLimit,
value: 100n,
})
.signAndSend(
address,
signer,
handleEvents(contract.api as ApiPromise, [0, eventList], res, rej)
);
})
.catch(rej);
});
const response = await pr;
console.log(response);
I noticed that this call resolves successfully with the polkadot-js web app from ink-waterfall: https://polkadotjs-apps.web.app/ , and the contracts-ui https://contracts-ui.substrate.io/contract .
Is there something I'm missing?