<divclass="link title"><ahref="/v5/">Documentation</a></div><divclass="base show link depth-1"><ahref="/v5/getting-started/">Getting Started</a></div><divclass="base show link depth-1"><ahref="/v5/concepts/">Ethereum Basics</a></div><divclass="hide link depth-2"><ahref="/v5/concepts/events/">Events</a></div><divclass="hide link depth-2"><ahref="/v5/concepts/gas/">Gas</a></div><divclass="hide link depth-2"><ahref="/v5/concepts/security/">Security</a></div><divclass="hide link depth-2"><ahref="/v5/concepts/best-practices/">Best Practices</a></div><divclass="base show link depth-1"><ahref="/v5/api-keys/">Provider API Keys</a></div><divclass="base ancestor show link depth-1"><ahref="/v5/api/">Application Programming Interface</a></div><divclass="show link depth-2"><ahref="/v5/api/providers/">Providers</a></div><divclass="hide link depth-3"><ahref="/v5/api/providers/provider/">Provider</a></div><divclass="hide link depth-3"><ahref="/v5/api/providers/jsonrpc-provider/">JsonRpcProvider</a></div><divclass="hide link depth-3"><ahref="/v5/api/providers/api-providers/">API Providers</a></div><divclass="hide link depth-3"><ahref="/v5/api/providers/other/">Other Providers</a></div><divclass="hide link depth-3"><ahref="/v5/api/providers/types/">Types</a></div><divclass="show link depth-2"><ahref="/v5/api/signer/">Signers</a></div><divclass="show link depth-2"><ahref="/v5/api/contract/">Contract Interaction</a></div><divclass="hide link depth-3"><ahref="/v5/api/contract/contract/">Contract</a></div><divclass="hide link depth-3"><ahref="/v5/api/contract/contract-factory/">ContractFactory</a></div><divclass="hide link depth-3"><ahref="/v5/api/contract/example/">Example: ERC-20 Contract</a></div><divclass="ancestor show link depth-2"><ahref="/v5/api/utils/">Utilities</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/abi/">Application Binary Interface</a></div><divclass="hide link depth-4"><ahref="/v5/api/utils/abi/coder/">AbiCoder</a></div><divclass="hide link depth-4"><ahref="/v5/api/utils/abi/formats/">ABI Formats</a></div><divclass="hide link depth-4"><ahref="/v5/api/utils/abi/fragments/">Fragments</a></div><divclass="hide link depth-4"><ahref="/v5/api/utils/abi/interface/">Interface</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/address/">Addresses</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/bignumber/">BigNumber</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/bytes/">Byte Manipulation</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/constants/">Constants</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/display-logic/">Display Logic and Input</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/encoding/">Encoding Utilities</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/fixednumber/">FixedNumber</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/hashing/">Hashing Algorithms</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/hdnode/">HD Wallet</a></div><divclass="myself ancestor ancestor show link depth-3"><ahref="/v5/api/utils/logger/">Logging</a></div><divclass="link show child depth-4"><ahref="#Logger">Logger</a></div><divclass="link show child depth-4"><ahref="#errors">Errors</a></div><divclass="link show child depth-4"><ahref="#Logger-levels">Log Levels</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/properties/">Property Utilities</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/signing-key/">Signing Key</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/strings/">Strings</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/transactions/">Transactions</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/web/">Web Utilities</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/wordlists/">Wordlists</a></div><divclass="show link depth-2"><ahref="/v5/api/other/">Other Libraries</a></div><divclass="hide link depth-3"><ahref="/v5/api/other/assembly/">Assembl
<aname="logging"></a><aname="logging"></a><h1class="show-anchors"><div>Logging<divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#logging"></a></div></div></h1><p>These are just a few simple logging utilities provided to simplify and standardize the error facilities across the Ethers library.</p>
<p>The <ahref="/v5/api/utils/logger/#Logger">Logger</a> library has zero dependencies and is intentionally very light so it can be easily included in each library.</p>
<p>The <ahref="/v5/api/utils/logger/#Logger--censorship">Censorship</a> functionality relies on one instance of the Ethers library being included. In large bundled packages or when <codeclass="inline">npm link</code> is used, this may not be the case. If you require this functionality, ensure that your bundling is configured properly.</p>
<divclass="property show-anchors"><divclass="signature"><spanclass="modifier">new </span><spanclass="path">ethers</span><spanclass="symbol">.</span><spanclass="path">utils</span><spanclass="symbol">.</span><spanclass="method">Logger</span><spanclass="symbol">(</span><spanclass="param">version</span><spanclass="symbol">)</span><divclass="anchors"><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/logger/src.ts/index.ts#L150">source</a></div></div><divclass="body"><p>Create a new logger which will include <i>version</i> in all errors thrown.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">Logger</span><spanclass="symbol">.</span><spanclass="method">globalLogger</span><spanclass="symbol">(</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns"><ahref="/v5/api/utils/logger/#Logger">Logger</a></span><divclass="anchors"><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/logger/src.ts/index.ts#L308">source</a></div></div><divclass="body"><p>Returns the singleton global logger.</p>
</div></div><aname="logging--Logger--errors"></a><h3class="show-anchors"><div>Errors<divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#logging--Logger--errors"></a></div></div></h3><p>These functions honor the current <ahref="/v5/api/utils/logger/#Logger--censorship">Censorship</a> and help create a standard error model for detecting and processing errors within Ethers.</p>
<divclass="property show-anchors"><divclass="signature"><spanclass="path">logger</span><spanclass="symbol">.</span><spanclass="method">makeError</span><spanclass="symbol">(</span><spanclass="param">message</span><spanclass="symbol">[</span><spanclass="symbol">,</span><spanclass="param">code</span> = <spanclass="param">UNKNOWN_ERROR</span><spanclass="symbol">[</span><spanclass="symbol">,</span><spanclass="param">params</span><spanclass="symbol">]</span><spanclass="symbol">]</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns">Error</span><divclass="anchors"><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/logger/src.ts/index.ts#L179">source</a></div></div><divclass="body"><p>Create an Error object with <i>message</i> and an optional <i>code</i> and additional <i>params</i> set. This is useful when an error is needed to be rejected instead of thrown.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">logger</span><spanclass="symbol">.</span><spanclass="method">throwError</span><spanclass="symbol">(</span><spanclass="param">message</span><spanclass="symbol">[</span><spanclass="symbol">,</span><spanclass="param">code</span> = <spanclass="param">UNKNOWN_ERROR</span><spanclass="symbol">[</span><spanclass="symbol">,</span><spanclass="param">params</span><spanclass="symbol">]</span><spanclass="symbol">]</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns">never</span><divclass="anchors"><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/logger/src.ts/index.ts#L216">source</a></div></div><divclass="body"><p>Throw an Error with <i>message</i> and an optional <i>code</i> and additional <i>params</i> set.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">logger</span><spanclass="symbol">.</span><spanclass="method">throwArgumentError</span><spanclass="symbol">(</span><spanclass="param">message</span><spanclass="symbol">,</span><spanclass="param">name</span><spanclass="symbol">,</span><spanclass="param">value</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns">never</span><divclass="anchors"><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/logger/src.ts/index.ts#L220">source</a></div></div><divclass="body"><p>Throw an <ahref="/v5/api/utils/logger/#errors--invalid-argument">INVALID_ARGUMENT</a> Error with <i>name</i> and <i>value</i>.</p>
</div></div><aname="logging--Logger--usage-validation"></a><h3class="show-anchors"><div>Usage Validation<divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#logging--Logger--usage-validation"></a></div></div></h3><p>There can be used to ensure various properties and actions are safe.</p>
<aname="Logger-checkAbstract"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">logger</span><spanclass="symbol">.</span><spanclass="method">checkAbstract</span><spanclass="symbol">(</span><spanclass="param">target</span><spanclass="symbol">,</span><spanclass="param">kind</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns">void</span><divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#Logger-checkAbstract"></a><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/logger/src.ts/index.ts#L296">source</a></div></div><divclass="body"><p>If <i>target</i> is <i>kind</i>, throws a <ahref="/v5/api/utils/logger/#errors--unsupported-operation">UNSUPPORTED_OPERATION</a> error otherwise performs the same operations as <ahref="/v5/api/utils/logger/#Logger-checkNew">checkNew</a>.</p>
</div></div><aname="Logger-checkArgumentCount"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">logger</span><spanclass="symbol">.</span><spanclass="method">checkArgumentCount</span><spanclass="symbol">(</span><spanclass="param">count</span><spanclass="symbol">,</span><spanclass="param">expectedCount</span><spanclass="symbol">[</span><spanclass="symbol">,</span><spanclass="param">message</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns">void</span><divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#Logger-checkArgumentCount"></a><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/logger/src.ts/index.ts#L268">source</a></div></div><divclass="body"><p>If <i>count</i> is not equal to <i>expectedCount</i>, throws a <ahref="/v5/api/utils/logger/#errors--missing-argument">MISSING_ARGUMENT</a> or <ahref="/v5/api/utils/logger/#errors--unexpected-argument">UNEXPECTED_ARGUMENT</a> error.</p>
</div></div><aname="Logger-checkNew"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">logger</span><spanclass="symbol">.</span><spanclass="method">checkNew</span><spanclass="symbol">(</span><spanclass="param">target</span><spanclass="symbol">,</span><spanclass="param">kind</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns">void</span><divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#Logger-checkNew"></a><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/logger/src.ts/index.ts#L290">source</a></div></div><divclass="body"><p>If <i>target</i> is not a valid <codeclass="inline">this</code> or <codeclass="inline">target</code> value, throw a <ahref="/v5/api/utils/logger/#errors--missing-new">MISSING_NEW</a> error. This is useful to ensure callers of a Class are using <codeclass="inline">new</code>.</p>
</div></div><aname="Logger-checkNoralize"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">logger</span><spanclass="symbol">.</span><spanclass="method">checkNormalize</span><spanclass="symbol">(</span><spanclass="param">message</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns">void</span><divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#Logger-checkNoralize"></a><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/logger/src.ts/index.ts#L237">source</a></div></div><divclass="body"><p>Check that the environment has a correctly functioning <ahref="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize">String.normalize</a>. If not, a <ahref="/v5/api/utils/logger/#errors--unsupported-operation">UNSUPPORTED_OPERATION</a> error is thrown.</p>
</div></div><aname="Logger-checkSafeUint53"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">logger</span><spanclass="symbol">.</span><spanclass="method">checkSafeUint53</span><spanclass="symbol">(</span><spanclass="param">value</span><spanclass="symbol">[</span><spanclass="symbol">,</span><spanclass="param">message</span><spanclass="symbol">]</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns">void</span><divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#Logger-checkSafeUint53"></a><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/logger/src.ts/index.ts#L246">source</a></div></div><divclass="body"><p>If <i>value</i> is not safe as a <ahref="https://en.wikipedia.org/wiki/Double-precision_floating-point_format">JavaScript number</a>, throws a <ahref="/v5/api/utils/logger/#errors--numeric-fault">NUMERIC_FAULT</a> error.</p>
</div></div><aname="Logger-setLogLevel"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">Logger</span><spanclass="symbol">.</span><spanclass="method">setLogLevel</span><spanclass="symbol">(</span><spanclass="param">logLevel</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns">void</span><divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#Logger-setLogLevel"></a><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/logger/src.ts/index.ts#L331">source</a></div></div><divclass="body"><p>Set the log level, to suppress logging output below a <ahref="/v5/api/utils/logger/#Logger-levels">particular log level</a>.</p>
</div></div><aname="errors"></a><aname="logging--errors"></a><h2class="show-anchors"><div>Errors<divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#errors"></a></div></div></h2><p>Every error in Ethers has a <codeclass="inline">code</code> value, which is a string that will match one of the following error codes.</p>
<aname="errors--not-implemented"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">Logger</span><spanclass="symbol">.</span><spanclass="path">errors</span><spanclass="symbol">.</span><spanclass="method">NOT_IMPLEMENTED</span><divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#errors--not-implemented"></a></div></div><divclass="body"><p>The operation is not implemented. This may occur when calling a method on a sub-class that has not fully implemented its abstract superclass.</p>
</div></div><aname="errors--server-error"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">Logger</span><spanclass="symbol">.</span><spanclass="path">errors</span><spanclass="symbol">.</span><spanclass="method">SERVER_ERROR</span><divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#errors--server-error"></a></div></div><divclass="body"><p>There was an error communicating with a server.</p>
<p>This may occur for a number of reasons, for example:</p>
<p><ul><li>a <ahref="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS">CORS</a> issue; this is quite often the problem and also the hardest to diagnose and fix, so it is very beneficial to familiarize yourself with CORS; some backends allow you configure your CORS, such as the geth command-line or conifguration files or the INFURA and Alchemy dashboards by specifing allowed Origins, methods, etc. </li><li>an SSL issue; for example, if you are trying to connect to a local node via HTTP but are serving the content from a secure HTTPS website </li><li>a link issue; a firewall is preventing the traffic from reaching the server </li><li>a server issue; the server is down, or is returning 500 error codes </li><li>a backend DDoS mitigation proxy; for example, Etherscan operates behind a Cloudflare proxy, which will block traffic if the request is sent via specific User Agents or the client fingerprint is detected as a bot in some cases </li></ul></p>
</div></div><aname="errors--unsupported-operation"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">Logger</span><spanclass="symbol">.</span><spanclass="path">errors</span><spanclass="symbol">.</span><spanclass="method">UNSUPPORTED_OPERATION</span><divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#errors--unsupported-operation"></a></div></div><divclass="body"><p>The operation is not supported.</p>
<p><ul><li>Some backends do not support certain operations; such as passing a blockTag to an <ahref="/v5/api/providers/api-providers/#EtherscanProvider">EtherscanProvider</a> for <ahref="/v5/api/providers/provider/#Provider-call">call</a></li><li>A <ahref="/v5/api/contract/contract/">Contract</a> object connected to <ahref="/v5/api/providers/provider/">Provider</a> (instead of a <ahref="/v5/api/signer/#Signer">Signer</a>) cannot <ahref="/v5/api/signer/#Signer-signTransaction">sign</a> or <ahref="/v5/api/signer/#Signer-sendTransaction">send</a> transactions </li><li>a <ahref="/v5/api/contract/contract/">Contract</a> connected to a <ahref="/v5/api/signer/#Signer">Signer</a> without a <ahref="/v5/api/providers/provider/">Provider</a> is write-only and cannot estimate gas or execute static calls </li></ul></p>
<aname="errors--buffer-overrun"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">Logger</span><spanclass="symbol">.</span><spanclass="path">errors</span><spanclass="symbol">.</span><spanclass="method">BUFFER_OVERRUN</span><divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#errors--buffer-overrun"></a></div></div><divclass="body"><p>The amount of data needed is more than the amount of data required, which would cause the data buffer to read past its end.</p>
<p>This can occur if a contract erroneously returns invalid ABI-encoded data or RLP data is malformed.</p>
</div></div><aname="errors--numeric-fault"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">Logger</span><spanclass="symbol">.</span><spanclass="path">errors</span><spanclass="symbol">.</span><spanclass="method">NUMERIC_FAULT</span><divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#errors--numeric-fault"></a></div></div><divclass="body"><p>There was an invalid operation done on numeric values.</p>
<p>Common cases of this occur when there is <ahref="https://en.wikipedia.org/wiki/Integer_overflow">overflow</a>, <ahref="https://en.wikipedia.org/wiki/Arithmetic_underflow">arithmetic underflow</a> in fixed numeric types or division by zero.</p>
<aname="errors--invalid-argument"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">Logger</span><spanclass="symbol">.</span><spanclass="path">errors</span><spanclass="symbol">.</span><spanclass="method">INVALID_ARGUMENT</span><divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#errors--invalid-argument"></a></div></div><divclass="body"><p>The type or value of an argument is invalid. This will generally also include the <codeclass="inline">name</code> and <codeclass="inline">value</code> of the argument. Any function which accepts sensitive data (such as a private key) will include the string <codeclass="inline">"[[REDACTED]]"</code> instead of the value passed in.</p>
</div></div><aname="errors--missing-argument"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">Logger</span><spanclass="symbol">.</span><spanclass="path">errors</span><spanclass="symbol">.</span><spanclass="method">MISSING_ARGUMENT</span><divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#errors--missing-argument"></a></div></div><divclass="body"><p>An expected parameter was not specified.</p>
</div></div><aname="errors--missing-new"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">Logger</span><spanclass="symbol">.</span><spanclass="path">errors</span><spanclass="symbol">.</span><spanclass="method">MISSING_NEW</span><divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#errors--missing-new"></a></div></div><divclass="body"><p>An object is a Class, but is not being called with <codeclass="inline">new</code>.</p>
</div></div><aname="errors--unexpected-argument"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">Logger</span><spanclass="symbol">.</span><spanclass="path">errors</span><spanclass="symbol">.</span><spanclass="method">UNEXPECTED_ARGUMENT</span><divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#errors--unexpected-argument"></a></div></div><divclass="body"><p>Too many parameters we passed into a function.</p>
<aname="errors--call-exception"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">Logger</span><spanclass="symbol">.</span><spanclass="path">errors</span><spanclass="symbol">.</span><spanclass="method">CALL_EXCEPTION</span><divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#errors--call-exception"></a></div></div><divclass="body"><p>An attempt to call a blockchain contract (getter) resulted in a revert or other error, such as insufficient gas (out-of-gas) or an invalid opcode. This can also occur during gas estimation or if waiting for a <ahref="/v5/api/providers/types/#providers-TransactionReceipt">TransactionReceipt</a> which failed during execution.</p>
<p>Consult the contract to determine the cause, such as a failed condition in a <codeclass="inline">require</code> statement. The <codeclass="inline">reason</code> property may provide more context for the cause of this error.</p>
</div></div><aname="errors--insufficient-funds"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">Logger</span><spanclass="symbol">.</span><spanclass="path">errors</span><spanclass="symbol">.</span><spanclass="method">INSUFFICIENT_FUNDS</span><divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#errors--insufficient-funds"></a></div></div><divclass="body"><p>The account is attempting to make a transaction which costs more than is available.</p>
<p>A sending account must have enough ether to pay for the value, the gas limit (at the gas price) as well as the intrinsic cost of data. The intrinsic cost of data is 4 gas for each zero byte and 68 gas for each non-zero byte, as well as 35000 gas if a transaction contains no <codeclass="inline">to</code> property and is therefore expected to create a new account.</p>
</div></div><aname="errors--network"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">Logger</span><spanclass="symbol">.</span><spanclass="path">errors</span><spanclass="symbol">.</span><spanclass="method">NETWORK_ERROR</span><divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#errors--network"></a></div></div><divclass="body"><p>An Ethereum network validation error, such as an invalid chain ID.</p>
</div></div><aname="errors--nonce-expired"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">Logger</span><spanclass="symbol">.</span><spanclass="path">errors</span><spanclass="symbol">.</span><spanclass="method">NONCE_EXPIRED</span><divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#errors--nonce-expired"></a></div></div><divclass="body"><p>The nonce being specified has already been used in a mined transaction.</p>
</div></div><aname="errors--replacement-underpriced"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">Logger</span><spanclass="symbol">.</span><spanclass="path">errors</span><spanclass="symbol">.</span><spanclass="method">REPLACEMENT_UNDERPRICED</span><divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#errors--replacement-underpriced"></a></div></div><divclass="body"><p>When replacing a transaction, by using a nonce which has already been sent to the network, but which has not been mined yet the new transaction must specify a higher gas price.</p>
<p>This error occurs when the gas price is insufficient to <i>bribe</i> the transaction pool to prefer the new transaction over the old one. Generally, the new gas price should be about 50% + 1 wei more, so if a gas price of 10 gwei was used, the replacement should be 15.000000001 gwei. This is not enforced by the protocol, as it deals with unmined transactions, and can be configured by each node, however to ensure a transaction is propagated to a miner it is best practice to follow the defaults most nodes have enabled.</p>
</div></div><aname="errors--unpredicatable-gas-limit"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">Logger</span><spanclass="symbol">.</span><spanclass="path">errors</span><spanclass="symbol">.</span><spanclass="method">UNPREDICTABLE_GAS_LIMIT</span><divclass="anchors"><aclass="self"href="/v5/api/utils/logger/#errors--unpredicatable-gas-limit"></a></div></div><divclass="body"><p>When estimating the required amount of gas for a transaction, a node is queried for its best guess.</p>
<p>If a node is unable (or unwilling) to predict the cost, this error occurs.</p>
<p>The best remedy for this situation is to specify a gas limit in the transaction manually.</p>
<p>This error can also indicate that the transaction is expected to fail regardless, if for example an account with no tokens is attempting to send a token.</p>
<divclass="property show-anchors"><divclass="signature"><spanclass="path">Logger</span><spanclass="symbol">.</span><spanclass="path">levels</span><spanclass="symbol">.</span><spanclass="method">DEBUG</span><divclass="anchors"></div></div><divclass="body"><p>Log all output, including debugging information.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">Logger</span><spanclass="symbol">.</span><spanclass="path">levels</span><spanclass="symbol">.</span><spanclass="method">INFO</span><divclass="anchors"></div></div><divclass="body"><p>Only log output for informational, warnings and errors.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">Logger</span><spanclass="symbol">.</span><spanclass="path">levels</span><spanclass="symbol">.</span><spanclass="method">WARNING</span><divclass="anchors"></div></div><divclass="body"><p>Only log output for warnings and errors.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">Logger</span><spanclass="symbol">.</span><spanclass="path">levels</span><spanclass="symbol">.</span><spanclass="method">ERROR</span><divclass="anchors"></div></div><divclass="body"><p>Only log output for errors.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">Logger</span><spanclass="symbol">.</span><spanclass="path">levels</span><spanclass="symbol">.</span><spanclass="method">OFF</span><divclass="anchors"></div></div><divclass="body"><p>Do not output any logs.</p>
<divclass="copyright">The content of this site is licensed under the <ahref="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on February 8, 2021, 3:25pm.</div>