You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There could be a better API, but currently, the particular value can be taken from the tx trace object.
import{CallItem}from'hardhat-tracer'// can be a read call, estimate gas, write txawaitcontract.method()// traverse to the right location in the trace and extract the gasUsedconsttrace1=hre.tracer.lastTrace()!;constcallItem=trace1.top?.children?.[0].children?.[0]asCallItem;constgasUsed=callItem.params.gasUsed!;
Imagine I wish to check gas_used by 2 traces inside transaction using
v2
?For example, I am writing gas tests for Limit Order Protocol, and wish to check gas used by protocol, so I am going to calculate
The text was updated successfully, but these errors were encountered: