diff --git a/.changeset/soft-ads-agree.md b/.changeset/soft-ads-agree.md new file mode 100644 index 0000000..0354f0b --- /dev/null +++ b/.changeset/soft-ads-agree.md @@ -0,0 +1,5 @@ +--- +'@rosen-chains/evm-rpc': patch +--- + +Fix EVM gas estimation so that only required fields are sent to the RPC diff --git a/packages/networks/evm-rpc/lib/EvmRpcNetwork.ts b/packages/networks/evm-rpc/lib/EvmRpcNetwork.ts index 3347141..fb5e467 100644 --- a/packages/networks/evm-rpc/lib/EvmRpcNetwork.ts +++ b/packages/networks/evm-rpc/lib/EvmRpcNetwork.ts @@ -300,8 +300,9 @@ class EvmRpcNetwork extends AbstractEvmNetwork { getGasRequired = async (transaction: Transaction): Promise => { try { const gas = await this.provider.estimateGas({ - ...transaction.toJSON(), from: this.lockAddress, + to: transaction.to, + data: transaction.data, }); this.logger.debug( `requested 'estimateGas' of ${