11import { type SignerConfig } from "../helpers/config.js" ;
2- import { type ContractTransaction } from "../helpers/ethers.js" ;
2+ import { type ContractTransaction , isPolygon } from "../helpers/ethers.js" ;
33import { validateTableName } from "../helpers/parser.js" ;
44import {
55 getContractAndOverrides ,
@@ -84,6 +84,12 @@ async function _mutateOne(
8484 signer ,
8585 chainId
8686 ) ;
87+ if ( isPolygon ( chainId ) ) {
88+ const gasLimit = await contract . estimateGas [
89+ "mutate(address,uint256,string)"
90+ ] ( caller , tableId , statement , overrides ) ;
91+ overrides . gasLimit = Math . floor ( gasLimit . toNumber ( ) * 1.2 ) ;
92+ }
8793 return await contract [ "mutate(address,uint256,string)" ] (
8894 caller ,
8995 tableId ,
@@ -101,6 +107,12 @@ async function _mutateMany(
101107 signer ,
102108 chainId
103109 ) ;
110+ if ( isPolygon ( chainId ) ) {
111+ const gasLimit = await contract . estimateGas [
112+ "mutate(address,(uint256,string)[])"
113+ ] ( caller , runnables , overrides ) ;
114+ overrides . gasLimit = Math . floor ( gasLimit . toNumber ( ) * 1.2 ) ;
115+ }
104116 return await contract [ "mutate(address,(uint256,string)[])" ] (
105117 caller ,
106118 runnables ,
0 commit comments