@truffle/codec
Version:
Library for encoding and decoding smart contract data
486 lines (485 loc) • 95.7 kB
HTML
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ContractEncoder | Truffle Decoding and Encoding</title><meta name="description" content="Documentation for Truffle Decoding and Encoding"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/search.js" id="tsd-search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
<div class="tsd-toolbar-contents container">
<div class="table-cell" id="tsd-search" data-base="..">
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
<div class="field">
<div id="tsd-toolbar-links"></div></div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Truffle Decoding and Encoding</a></div>
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
<div class="container container-main">
<div class="col-content">
<div class="tsd-page-title">
<ul class="tsd-breadcrumb">
<li><a href="../index.html">Truffle Decoding and Encoding</a></li>
<li><a href="../modules/_truffle_encoder.html">@truffle/encoder</a></li>
<li><a href="_truffle_encoder.ContractEncoder.html">ContractEncoder</a></li></ul>
<h1>Class ContractEncoder</h1></div>
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography"><p>The ContractEncoder class.
Can encode transactions, resolve overloads, and wrap values.
See below for a method listing.</p>
</div>
<div class="tsd-comment tsd-typography"></div></section>
<section class="tsd-panel tsd-hierarchy">
<h4>Hierarchy</h4>
<ul class="tsd-hierarchy">
<li><span class="target">ContractEncoder</span></li></ul></section><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/trufflesuite/truffle/blob/8c81e30a6/packages/encoder/lib/encoders.ts#L655">encoder/lib/encoders.ts:655</a></li></ul></aside>
<section class="tsd-panel-group tsd-index-group">
<section class="tsd-panel tsd-index-panel">
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
<h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex=0><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M1.5 5.50969L8 11.6609L14.5 5.50969L12.5466 3.66086L8 7.96494L3.45341 3.66086L1.5 5.50969Z" fill="var(--color-text)"></path></svg> Index</h5></summary>
<div class="tsd-accordion-details">
<section class="tsd-index-section">
<h3 class="tsd-index-heading">Constructors</h3>
<div class="tsd-index-list"><a href="_truffle_encoder.ContractEncoder.html#constructor" class="tsd-index-link tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-512"><rect fill="var(--color-icon-background)" stroke="#4D7FFF" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g></svg><span>constructor</span></a>
</div></section>
<section class="tsd-index-section">
<h3 class="tsd-index-heading">Properties</h3>
<div class="tsd-index-list"><a href="_truffle_encoder.ContractEncoder.html#abi" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-1024"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g></svg><span>abi</span></a>
<a href="_truffle_encoder.ContractEncoder.html#artifact" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>artifact</span></a>
<a href="_truffle_encoder.ContractEncoder.html#compilation" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>compilation</span></a>
<a href="_truffle_encoder.ContractEncoder.html#constructorBinary" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>constructor<wbr/>Binary</span></a>
<a href="_truffle_encoder.ContractEncoder.html#constructorContextHash" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>constructor<wbr/>Context<wbr/>Hash</span></a>
<a href="_truffle_encoder.ContractEncoder.html#contract" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>contract</span></a>
<a href="_truffle_encoder.ContractEncoder.html#contractNode" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>contract<wbr/>Node</span></a>
<a href="_truffle_encoder.ContractEncoder.html#deployedContextHash" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>deployed<wbr/>Context<wbr/>Hash</span></a>
<a href="_truffle_encoder.ContractEncoder.html#noBytecodeAllocations" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>no<wbr/>Bytecode<wbr/>Allocations</span></a>
<a href="_truffle_encoder.ContractEncoder.html#projectEncoder" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>project<wbr/>Encoder</span></a>
</div></section>
<section class="tsd-index-section">
<h3 class="tsd-index-heading">Methods</h3>
<div class="tsd-index-list"><a href="_truffle_encoder.ContractEncoder.html#encodeCreation" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-2048"><rect fill="var(--color-icon-background)" stroke="#FF4DB8" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.162 16V7.24H10.578L11.514 10.072C11.602 10.328 11.674 10.584 11.73 10.84C11.794 11.088 11.842 11.28 11.874 11.416C11.906 11.28 11.954 11.088 12.018 10.84C12.082 10.584 12.154 10.324 12.234 10.06L13.122 7.24H14.538V16H13.482V12.82C13.482 12.468 13.49 12.068 13.506 11.62C13.53 11.172 13.558 10.716 13.59 10.252C13.622 9.78 13.654 9.332 13.686 8.908C13.726 8.476 13.762 8.1 13.794 7.78L12.366 12.16H11.334L9.894 7.78C9.934 8.092 9.97 8.456 10.002 8.872C10.042 9.28 10.078 9.716 10.11 10.18C10.142 10.636 10.166 11.092 10.182 11.548C10.206 12.004 10.218 12.428 10.218 12.82V16H9.162Z" fill="var(--color-text)"></path></g></svg><span>encode<wbr/>Creation</span></a>
<a href="_truffle_encoder.ContractEncoder.html#encodeTransaction" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>encode<wbr/>Transaction</span></a>
<a href="_truffle_encoder.ContractEncoder.html#encodeTxNoResolution" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>encode<wbr/>Tx<wbr/>No<wbr/>Resolution</span></a>
<a href="_truffle_encoder.ContractEncoder.html#forInstance" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>for<wbr/>Instance</span></a>
<a href="_truffle_encoder.ContractEncoder.html#getAbis" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Abis</span></a>
<a href="_truffle_encoder.ContractEncoder.html#getConstructorAbi" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Constructor<wbr/>Abi</span></a>
<a href="_truffle_encoder.ContractEncoder.html#getConstructorMethod" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Constructor<wbr/>Method</span></a>
<a href="_truffle_encoder.ContractEncoder.html#getMethod" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Method</span></a>
<a href="_truffle_encoder.ContractEncoder.html#getProjectEncoder" class="tsd-index-link tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Project<wbr/>Encoder</span></a>
<a href="_truffle_encoder.ContractEncoder.html#resolveAndWrap" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>resolve<wbr/>And<wbr/>Wrap</span></a>
<a href="_truffle_encoder.ContractEncoder.html#wrap" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>wrap</span></a>
<a href="_truffle_encoder.ContractEncoder.html#wrapElementaryValue" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>wrap<wbr/>Elementary<wbr/>Value</span></a>
<a href="_truffle_encoder.ContractEncoder.html#wrapForTransaction" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>wrap<wbr/>For<wbr/>Transaction</span></a>
</div></section></div></details></section></section>
<section class="tsd-panel-group tsd-member-group">
<h2>Constructors</h2>
<section class="tsd-panel tsd-member tsd-is-protected"><a id="constructor" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><g stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" id="icon-anchor"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></g></svg></a></h3>
<ul class="tsd-signatures tsd-is-protected">
<li class="tsd-signature tsd-anchor-link" id="constructor.new_ContractEncoder"><span class="tsd-kind-constructor-signature">new <wbr/>Contract<wbr/>Encoder</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">projectEncoder</span>, <span class="tsd-kind-parameter">compilation</span>, <span class="tsd-kind-parameter">contract</span>, <span class="tsd-kind-parameter">artifact</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_truffle_encoder.ContractEncoder.html" class="tsd-signature-type tsd-kind-class">ContractEncoder</a><a href="#constructor.new_ContractEncoder" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
<li class="tsd-description"><code class="tsd-tag ts-flagProtected">Protected</code>
<div class="tsd-parameters">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameter-list">
<li>
<h5><span class="tsd-kind-parameter">projectEncoder</span>: <a href="_truffle_encoder.ProjectEncoder.html" class="tsd-signature-type tsd-kind-class">ProjectEncoder</a></h5></li>
<li>
<h5><span class="tsd-kind-parameter">compilation</span>: <a href="../interfaces/_truffle_codec.Compilations.Compilation.html" class="tsd-signature-type tsd-kind-interface">Compilation</a></h5></li>
<li>
<h5><span class="tsd-kind-parameter">contract</span>: <a href="../interfaces/_truffle_codec.Compilations.Contract.html" class="tsd-signature-type tsd-kind-interface">Contract</a></h5></li>
<li>
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">artifact</span>: <span class="tsd-signature-type ">ContractObject</span></h5></li></ul></div>
<h4 class="tsd-returns-title">Returns <a href="_truffle_encoder.ContractEncoder.html" class="tsd-signature-type tsd-kind-class">ContractEncoder</a></h4>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/trufflesuite/truffle/blob/8c81e30a6/packages/encoder/lib/encoders.ts#L680">encoder/lib/encoders.ts:680</a></li></ul></aside></li></ul></section></section>
<section class="tsd-panel-group tsd-member-group">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-is-private"><a id="abi" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>abi</span><a href="#abi" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<div class="tsd-signature"><span class="tsd-kind-property">abi</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">Abi</span></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/trufflesuite/truffle/blob/8c81e30a6/packages/encoder/lib/encoders.ts#L658">encoder/lib/encoders.ts:658</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-is-private"><a id="artifact" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>artifact</span><a href="#artifact" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<div class="tsd-signature"><span class="tsd-kind-property">artifact</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">ContractObject</span></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/trufflesuite/truffle/blob/8c81e30a6/packages/encoder/lib/encoders.ts#L659">encoder/lib/encoders.ts:659</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-is-private"><a id="compilation" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>compilation</span><a href="#compilation" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<div class="tsd-signature"><span class="tsd-kind-property">compilation</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/_truffle_codec.Compilations.Compilation.html" class="tsd-signature-type tsd-kind-interface">Compilation</a></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/trufflesuite/truffle/blob/8c81e30a6/packages/encoder/lib/encoders.ts#L667">encoder/lib/encoders.ts:667</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-is-private"><a id="constructorBinary" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>constructor<wbr/>Binary</span><a href="#constructorBinary" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<div class="tsd-signature"><span class="tsd-kind-property">constructor<wbr/>Binary</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/trufflesuite/truffle/blob/8c81e30a6/packages/encoder/lib/encoders.ts#L660">encoder/lib/encoders.ts:660</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-is-private"><a id="constructorContextHash" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>constructor<wbr/>Context<wbr/>Hash</span><a href="#constructorContextHash" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<div class="tsd-signature"><span class="tsd-kind-property">constructor<wbr/>Context<wbr/>Hash</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/trufflesuite/truffle/blob/8c81e30a6/packages/encoder/lib/encoders.ts#L661">encoder/lib/encoders.ts:661</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-is-private"><a id="contract" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>contract</span><a href="#contract" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<div class="tsd-signature"><span class="tsd-kind-property">contract</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/_truffle_codec.Compilations.Contract.html" class="tsd-signature-type tsd-kind-interface">Contract</a></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/trufflesuite/truffle/blob/8c81e30a6/packages/encoder/lib/encoders.ts#L657">encoder/lib/encoders.ts:657</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-is-private"><a id="contractNode" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>contract<wbr/>Node</span><a href="#contractNode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<div class="tsd-signature"><span class="tsd-kind-property">contract<wbr/>Node</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/_truffle_codec.Ast.AstNode.html" class="tsd-signature-type tsd-kind-interface">AstNode</a></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/trufflesuite/truffle/blob/8c81e30a6/packages/encoder/lib/encoders.ts#L666">encoder/lib/encoders.ts:666</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-is-private"><a id="deployedContextHash" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>deployed<wbr/>Context<wbr/>Hash</span><a href="#deployedContextHash" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<div class="tsd-signature"><span class="tsd-kind-property">deployed<wbr/>Context<wbr/>Hash</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/trufflesuite/truffle/blob/8c81e30a6/packages/encoder/lib/encoders.ts#L662">encoder/lib/encoders.ts:662</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-is-private"><a id="noBytecodeAllocations" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>no<wbr/>Bytecode<wbr/>Allocations</span><a href="#noBytecodeAllocations" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<div class="tsd-signature"><span class="tsd-kind-property">no<wbr/>Bytecode<wbr/>Allocations</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span>[<span class="tsd-kind-index-signature">selector</span>: <span class="tsd-signature-type">string</span>]<span class="tsd-signature-symbol">: </span><a href="../types/_truffle_codec.AbiData.Allocate.CalldataAndReturndataAllocation.html" class="tsd-signature-type tsd-kind-type-alias">CalldataAndReturndataAllocation</a><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-index-signature">
<h5><span class="tsd-signature-symbol">[</span><span class="tsd-kind-parameter">selector</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]: </span><a href="../types/_truffle_codec.AbiData.Allocate.CalldataAndReturndataAllocation.html" class="tsd-signature-type tsd-kind-type-alias">CalldataAndReturndataAllocation</a></h5></li></ul></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/trufflesuite/truffle/blob/8c81e30a6/packages/encoder/lib/encoders.ts#L663">encoder/lib/encoders.ts:663</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-is-private"><a id="projectEncoder" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>project<wbr/>Encoder</span><a href="#projectEncoder" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<div class="tsd-signature"><span class="tsd-kind-property">project<wbr/>Encoder</span><span class="tsd-signature-symbol">:</span> <a href="_truffle_encoder.ProjectEncoder.html" class="tsd-signature-type tsd-kind-class">ProjectEncoder</a></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/trufflesuite/truffle/blob/8c81e30a6/packages/encoder/lib/encoders.ts#L656">encoder/lib/encoders.ts:656</a></li></ul></aside></section></section>
<section class="tsd-panel-group tsd-member-group">
<h2>Methods</h2>
<section class="tsd-panel tsd-member"><a id="encodeCreation" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>encode<wbr/>Creation</span><a href="#encodeCreation" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<ul class="tsd-signatures">
<li class="tsd-signature tsd-anchor-link" id="encodeCreation.encodeCreation-1"><span class="tsd-kind-call-signature">encode<wbr/>Creation</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">inputs</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/_truffle_codec.Options.html" class="tsd-signature-type tsd-kind-interface">Options</a><span class="tsd-signature-symbol">></span><a href="#encodeCreation.encodeCreation-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
<li class="tsd-description">
<div class="tsd-comment tsd-typography"><p><strong>This method is asynchronous.</strong></p>
<p>This method is similar to [[encodeTransaction]], except that instead of
encoding a function transaction, it encodes a creation transaction.</p>
<p>Because this method does not perform overload resolution, it only returns
the resulting transaction options (including the encoded <code>data</code>), and does
not bother returning the ABI used (as this was user-supplied.)</p>
<p>If the <code>allowOptions</code> flag is set in the <code>options</code> argument, the input may
contain an additional transaction options argument after the other
arguments. Any non-<code>data</code> options not specified in such a transaction
options argument will be simply omitted; it you want some options to have
defaults, it is up to the you to set these options as appropriate
afterwards.</p>
<p>If the transaction options parameter has a <code>data</code> or a <code>to</code> option,
these option will be recognized but ignored.</p>
<p>See [[encodeTransaction]] for documentation of the inputs.</p>
</div>
<div class="tsd-parameters">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameter-list">
<li>
<h5><span class="tsd-kind-parameter">inputs</span>: <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">[]</span></h5></li>
<li>
<h5><span class="tsd-kind-parameter">options</span>: <a href="../interfaces/_truffle_encoder.ResolveOptions.html" class="tsd-signature-type tsd-kind-interface">ResolveOptions</a><span class="tsd-signature-symbol"> = {}</span></h5></li></ul></div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/_truffle_codec.Options.html" class="tsd-signature-type tsd-kind-interface">Options</a><span class="tsd-signature-symbol">></span></h4>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/trufflesuite/truffle/blob/8c81e30a6/packages/encoder/lib/encoders.ts#L1323">encoder/lib/encoders.ts:1323</a></li></ul></aside></li></ul></section>
<section class="tsd-panel tsd-member"><a id="encodeTransaction" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>encode<wbr/>Transaction</span><a href="#encodeTransaction" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<ul class="tsd-signatures">
<li class="tsd-signature tsd-anchor-link" id="encodeTransaction.encodeTransaction-1"><span class="tsd-kind-call-signature">encode<wbr/>Transaction</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">abisOrNameOrSig</span>, <span class="tsd-kind-parameter">inputs</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/_truffle_encoder.TxAndAbi.html" class="tsd-signature-type tsd-kind-interface">TxAndAbi</a><span class="tsd-signature-symbol">></span><a href="#encodeTransaction.encodeTransaction-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
<li class="tsd-description">
<div class="tsd-comment tsd-typography"><p><strong>This method is asynchronous.</strong></p>
<p>This method recognizes user input for a given set of contract methods,
attempts to interpret it as valid input for one of them, and then
encodes the result. (That is to say, it performs overload resolution,
then encodes.) Note that this method cannot be used to encode contract
creations; use [[encodeTxNoResolution]] for that.</p>
<p>If this method cannot match the user input to any of the possible
overloads, it will throw a [[TypeMismatchError]] or a
[[NoOverloadsMatchedError]]. If more than one overload matches but none
can be considered the unique best, you will get a
[[NoUniqueBestOverloadError]]. If due to inputting a nonexistent function
name there are no overloads to check, you will get a
[[NoFunctionByThatNameError]]. See below for a full list of the accepted
forms of input, and see [[resolveAndWrap]] for full documentation of the
overload resolution system.</p>
<p>Be aware that overload resolution may not always be fully reliable; if you
want to be absolutely certain that you get the right overload, you can use
[[encodeTxNoResolution]], which does not perform overload resolution, but
requires you to specify exactly which overload you mean. However, you can
also adjust your input to this function to get the overload you want; see
below about <code>{ type: ..., value: ... }</code> input and enum string input for
details.</p>
<p>If the <code>allowOptions</code> flag is set in the <code>options</code> argument, the input may
contain an additional transaction options argument after the other
arguments. Any non-<code>data</code> options not specified in such a transaction
options argument will be simply omitted; it you want some options to have
defaults, it is up to the you to set these options as appropriate
afterwards. Also, if the transaction options parameter has a <code>data</code>
option, this option will be recognized but ignored.</p>
<p>Use of the encoder for transactions to be sent to libraries is
presently not supported and may have unreliable results. Limited support
for this is planned for future versions.</p>
<p><strong>Accepted forms of input</strong></p>
<p>The <code>input</code> argument may come in a number of forms, depending on the
target data type. A list of the specific inputs accepted for each type is
below. However first we must note a few generic forms that inputs are
accepted in.</p>
<p>Inputs may be given as an object of the form <code>{ type: ..., value: ... }</code>
(additional fields not allowed), where <code>type</code> is a string describing the
type, and <code>value</code> is anything that would be accepted for that type (other
than another type/value object). This form of input is not very useful
with <em>this</em> method, but it is useful when performing overload resolution
(see [[resolveAndWrap]]) to restrict the overloads that will be selected
from. Note that for arrays, <code>type</code> should simply be <code>"array"</code>; for
structs and tuples, <code>"struct"</code> or <code>"tuple"</code>; for addresses and contracts,
<code>"address"</code> or <code>"contract"</code>; for external functions, <code>"function"</code>; for
transaction options, <code>"options"</code>; and for enums, it can be either <code>"enum"</code>
(or the underlying uint type). For other Solidity types, it should be the
name of the type; note that <code>"uint"</code>, <code>"int"</code>, <code>"fixed"</code>, <code>"ufixed"</code>, and
<code>"byte"</code> are accepted. Vyper's <code>"decimal"</code> type is also accepted.
Also, user-defined value types use exactly the same
<code>type</code> field as the underlying type; this input format does not distinguish
between them and the underlying type.</p>
<p>Note that input in the form of a [[Format.Values.Value|Value]] is
accepted, so long as the type is appropriate, but error results are
typically not accepted (exceptions are discussed below).</p>
<p>Now then, the list of accepted inputs by type, excluding the above:</p>
<p><strong>Strings</strong>: The input may be given as string (or <code>String</code>); note that
strings with invalid UTF-16 will not be accepted. It may also be given as a
<code>Uint8Array</code> (or anything that mimics one; see below about bytestrings), which
will be treated as UTF-8; note that invalid UTF-8 is allowed in this format.
Strings may also be given as a [[Format.Values.StringValue|StringValue]].</p>
<p><strong>Integer types</strong>: Input for integer types may take a variety of forms.
The input may be a <code>number</code> (or <code>Number</code>); note that if so it must be a
safe integer. For larger integers, you must use other forms of input.
For instance, the input may be a <code>BigInt</code>. The input may also be one
of several recognized big number classes:</p>
<ul>
<li><a href="https://github.com/indutny/bn.js"><code>BN</code></a></li>
<li><a href="https://github.com/MikeMcl/Big.js"><code>Big</code></a></li>
<li>MikeMcl's <a href="https://github.com/MikeMcl/bignumber.js"><code>BigNumber</code></a></li>
<li>Ethers's <a href="https://www.npmjs.com/package/@ethersproject/bignumber"><code>BigNumber</code> or <code>FixedNumber</code></a>
Of course, any numeric input, no matter the format, must be integral.
Input may also take the form of a numeric string (or <code>String</code>).
The string may be decimal, but it may also be hexadecimal with <code>"0x"</code>
prefix, octal with <code>"0o"</code> prefix, or binary with <code>"0xb"</code> prefix.
You can also use a negated hexadecimal, octal, or binary string to
represent a negative number. Whitespace before or after the number is OK,
and you may use underscores to separate groups of digits (in any base).
For decimal strings, scientific notation (e.g. <code>1.1e4</code>) is also accepted.
It is also possible to affix one of the units <code>"wei"</code>, <code>"gwei"</code>,
<code>"shannon"</code>, <code>"finney"</code>, <code>"szabo"</code>, or <code>"ether"</code> (these are case-insensitive)
onto a decimal numeric string (you may include space inbetween the
quantity and the unit) to act as a multiplier (where here the
assumption is that 1 wei means the number 1). You may also use a
unit by itself, with no specified quantity, to mean 1 of that unit.
(E.g., an input of <code>"wei"</code> will be interpreted as 1.) Note that it's OK
if the quantity before the unit is not itself an integer, so long as the
overall resulting quantity is an integer; e.g., "1.1 gwei" is legal integer
input. In addition to giving the input in any of these obviously numeric
forms, the input may also be given a a <code>Uint8Array</code> or anything that
mimics one (see above about bytestrings); in this case the input will
be interpreted as the big-endian byte representation of an unsigned
integer (or in other words, it will be interpreted as base 256).
Negative numbers cannot be represented in this way.
Finally, the input may be given as a
[[Format.Values.UintValue|UintValue]],
[[Format.Values.IntValue|IntValue]],
[[Format.Values.UfixedValue|UfixedValue]],
[[Format.Values.FixedValue|FixedValue]],
[[Format.Values.UserDefinedTypeValue|UserDefinedTypeValue]] on top of one of these,
or [[Format.Values.EnumValue|EnumValue]]; the type is not required to
match unless strict checking is on (see [[resolveAndWrap]]), in which case
the type must match exactly. In addition, the input may also be a
[[Format.Errors.EnumErrorResult|EnumErrorResult]] so long as
the error is a
[[Format.Errors.EnumOutOfRangeError|EnumOutOfRangeError]];
other types of error results are not accepted.</li>
</ul>
<p><strong>Enums</strong>: Enums accept all the same forms of input as integer types.
However, if the encoder is aware that a particular argument or field is in
fact an enum and not just an integer, it accepts one additional form of
input; the input may be a string (or <code>String</code>) containing the name of the
enumerated option. So, for instance, given the following Solidity code:</p>
<pre><code class="language-solidity"><span class="hl-3">contract</span><span class="hl-9"> MyContract</span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-3">enum</span><span class="hl-2"> </span><span class="hl-9">Ternary</span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-10">No</span><span class="hl-2">, </span><span class="hl-10">Yes</span><span class="hl-2">, </span><span class="hl-10">Maybe</span><br/><span class="hl-2"> }</span><br/><span class="hl-2">}</span>
</code><button>Copy</button></pre>
<p>then <code>"Yes"</code> would be a valid input for an enum of type
<code>MyContract.Ternary</code>. Moreover, <code>"Ternary.Yes"</code> and
<code>"MyContract.Ternary.Yes"</code> would also work; these latter forms will only
match enum types with the appropriate name and optionally defining
contract, so you can use these to restrict matching for overload
resolution, much like type/value input. Note these forms do not require
the enum to be defined inside of a contract; those defined outside of
contracts are supported too, so long as the encoder was initialized to
know about them.</p>
<p><strong>Bytestrings</strong>: Bytestrings can be given in several forms. Note that for
all forms of input, if the specified type is <code>bytesN</code>, it is OK if the
length of the input is shorter than N bytes; it will automatically be
right-padded with zero bytes in this case. (The exception is if the input
is a [[Format.Values.BytesValue|BytesValue]] and strict checking is
on; see [[resolveAndWrap]].) Bytestrings may be given as <code>"0x"</code>-prefixed
even-length hex strings (a <code>String</code> may be used in place of a string);
underscores may be used to separate groups of hex digits.
Bytestrings may also be given as a <code>Uint8Array</code>, or anything resembling a
<code>Uint8Array</code> -- any object with a <code>length</code> field which is a <code>number</code>, and
which has fields from <code>0</code> to <code>length-1</code> all <code>number</code>s from 0 to 255, will
be accepted. Input may also be given as a
[[Format.Values.BytesValue|BytesValue]] or a
[[Format.Values.UserDefinedTypeValue|UserDefinedTypeValue]]
on top of one; the specific type does not
have to match unless strict checking is on. In addition, a bytestring may be
given as an object with just the fields <code>text</code> and <code>encoding</code>; in this
case, <code>text</code> should be a string (it must not have invalid UTF-16) and
<code>encoding</code> an encoding to encode it as. The only supported encoding
currently is <code>"utf8"</code>. Finally, for compatibility with ethers, when
strict checking is off (see [[resolveAndWrap]]), a
bytestring of dynamic length (<code>bytes</code>) may have its input given numerically.
The valid formats for this are the same as for integer types, except that
wrapped numeric values are not accepted, numeric strings may not use
scientific notation or units, and the number may not be negative. For
compatibility reasons, if the number zero is given as input in this way,
it will be treated as a bytestring consisting of a single zero byte, rather
than the empty bytestring. Warning: an odd-length hex string will be
treated as numeric input! (Effectively, it will be padded on the left
with a zero hex digit.)</p>
<p><strong>Addresses and contracts</strong>: Input may be given as a hex string
representing 20 bytes, with capitalization according to the Ethereum
address checksum. The <code>"0x"</code> prefix is optional. If the hex string
is all lowercase or all uppercase, however, then the checksum check will
be skipped, and the input accepted regardless. Input may also be given
as an ICAP address; again, the checksum must be correct. Finally, if ENS
resolution has been configured, input may be given as an ENS name.
All of these may also be given as <code>String</code>s instead of strings.
Input may also be given as an object with an <code>address</code> field, although the
contents of that address field must be a <code>"0x"</code>-prefixed hex string (not
<code>String</code>), and not any other address format. Input may also be given
as a [[Format.Values.AddressValue|AddressValue]],
[[Format.Values.UserDefinedTypeValue|UserDefinedTypeValue]] on top of such, or
[[Format.Values.ContractValue|ContractValue]]; the specific type
does not matter.</p>
<p><strong>Booleans</strong>: Unless the <code>strictBooleans</code> option is passed, almost any
input is accepted (as long as it's not type/value input for a different
type), but how it is interpreted depends on the input. A boolean will be
interpreted in the obvious way, and a <code>Boolean</code> will be unwrapped. A
string will be considered true unless it is falsy or is equal (ignoring
case) to the string <code>"false"</code>; however, if <code>strictBooleans</code> is passed, then
only strings that are (ignoring case) equal to <code>"true"</code> or <code>"false"</code> will
be accepted. A <code>String</code> will be
considered true if and only if the underlying string is. A number will be
considered true so long as it is truthy, and a <code>Number</code> will be considered
true if and only if the underlying number is. A
[[Format.Values.BoolValue|BoolValue]], or
[[Format.Values.UserDefinedTypeValue|UserDefinedTypeValue]] on top of such,
will be considered true so
long as it represents a true value. Moreover, two types of
[[Format.Errors.BoolErrorResult|BoolErrorResult]] also count as
true: Those where the error is a
[[Format.Errors.BoolOutOfRangeError|BoolOutOfRangeError]] and
those where the error is a
[[Format.Errors.BoolPaddingError|BoolPaddingError]]. This also applies to
a [[Format.Errors.UserDefinedTypeValue|UserDefinedTypeErrors]] on top of one
of these. All other
error results, and all [[Format.Values.Value|Values]] that are not
[[Format.Values.BoolValue|BoolValues]] or a
[[Format.Values.UserDefinedTypeValue|UserDefinedTypeValue]] on top of one,
will be rejected. All other inputs will be considered true so long as
they are truthy, unless <code>strictBooleans</code> is passed, in which case they will
be rejected.</p>
<p><strong>Decimal fixed-point types</strong>: Input for fixed-point decimal types is
similar to input for integer types. The differences are as follows:</p>
<ul>
<li>Units are not accepted in numeric strings (or <code>String</code>s).</li>
<li>Hexadecimal, octal, and binary strings (or <code>String</code>s) are not
accepted.</li>
<li><code>Uint8Array</code>s, or objects that mimic them, are not accepted.</li>
<li>Numeric values do not have to be integral.
Note that if the input is a <code>number</code> (or <code>Number</code>) or MikeMcl
<a href="https://github.com/MikeMcl/bignumber.js">BigNumber</a>, it must be a finite
value. Also, the number of decimal places in the input may not exceed the
number of decimal places allowed in the type. Finally, just as integer
types do not allow <code>number</code>s (or <code>Number</code>s) that are unsafe integers as
input, decimal types will not accept a <code>number</code> (or <code>Number</code>) as input if
that <code>number</code> is outside the safe range for that type, i.e., it is large
enough that there may be loss of precision. (This means that <code>1</code> is not
valid input for a <code>fixed128x18</code>!) Using other, safer, forms of input is
encouraged.</li>
</ul>
<p><strong>User-defined value types</strong>: These take exactly the same input as the
underlying type.</p>
<p><strong>Arrays</strong>: The input may be an array, or it may be a
[[Format.Values.ArrayValue|ArrayValue]]. In the latter case,
whether it is static-length or dynamic-length does not need to match
(unless strict checking is on, see [[resolveAndWrap]]). If the <code>allowJson</code>
option is passed, the array may also be a JSON string. Note that any allowed
format is allowed for the individual elements.</p>
<p><strong>Structs and tuples</strong>: The input can be given either as an array or as an
object; if the <code>allowJson</code> option is passed, it may also be given as a
JSON string for one of these (any format is allowed for the individual
elements). If given as an array, the elements should be the members of
the struct/tuple, in order. If given as an object, it should be keyed by
the struct or tuple's field names; if any of the elements of the tuple are
unnamed, then input cannot be given as an object. Additional keys are
also allowed unless strict checking is on. Input may also be given as a
[[Format.Values.StructValue|StructValue]] or
[[Format.Values.TupleValue|TupleValue]]; the specific type does not
matter.</p>
<p><strong>External function pointers</strong>: These may be given as an object with fields
<code>address</code> and <code>selector</code> (additional fields are allowed); the <code>address</code>
field may be anything that would be recognized as an address (see above),
and the <code>selector</code> field may be anything that would be recgonized as a
<code>bytes4</code> (see above). Alternatively, this may be given as a bytestring
(even length <code>"0x"</code>-prefixed hex string or <code>String</code>) of 24 bytes,
specifying the address followed by the selector; in this case, the address
does not need to be checksummed. Finally, input may of course also be
given as a
[[Format.Values.FunctionExternalValue|FunctionExternalValue]];
its more specific type does not matter.</p>
<ul>
<li>Transaction options: These are given as an object with fields for the
desired options (you can leave options out or have them be <code>undefined</code> and
they'll be ignored). Note that, in order to maintain compatibility with
older versions of Truffle, additional keys are accepted, but there must be
at least one key that belongs in a transaction options object. Note that
if any field exists, and is not <code>undefined</code>, but the value of that field
cannot be interpreted as input of the appropriate type, the input will be
rejected. Otherwise, inputs for each field can be anything that the
encoder will understand for this field. Accepted fields are:<ul>
<li><code>gas</code>, <code>gasPrice</code>, <code>value</code>, <code>nonce</code>: These take integer input
(see above).</li>
<li><code>from</code>, <code>to</code>: These take address input (see above).</li>
<li><code>data</code>: This takes <code>bytes</code> input (see above).</li>
<li><code>overwrite</code>: This takes boolean input (see above).</li>
<li><code>type</code>: This takes integer input, which must be in the range from
0 to <code>0xbf</code>.</li>
<li><code>accessList</code>: This takes input as if for an array of type <code>AccessListForAddress[]</code>,
if <code>AccessListForAddress</code> were a struct with two fields, <code>address</code> and <code>storageKeys</code>,
with <code>address</code> being an <code>address</code> and <code>storageKeys</code> being of type <code>uint256[]</code>.
Yes, this means storage keys may be given numerically; it also means that if a
storage key is given as a hex string representing less than 32 bytes, it will be
padded on the left, rather than on the right.</li>
<li><code>privateFor</code>: This one is a special case, and requires a specific
form of input. Input must be an array of base64-encoded
bytestrings (as strings or <code>String</code>s), each with a decoded length of
32 bytes.
In addition, input may also be given as a
[[Format.Values.OptionsValue|OptionsValue]].</li>
</ul>
</li>
</ul>
</div>
<div class="tsd-parameters">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameter-list">
<li>
<h5><span class="tsd-kind-parameter">abisOrNameOrSig</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">FunctionEntry</span><span class="tsd-signature-symbol">[]</span></h5>
<div class="tsd-comment tsd-typography"><p>The ABI entries for the overloads, or the name
or full signature of the function. Note that if you are inputting ABI
entries, they must be for functions, not constructors. The entries must
be ones associated with this contract.</p>
</div>
<div class="tsd-comment tsd-typography"></div></li>
<li>
<h5><span class="tsd-kind-parameter">inputs</span>: <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">[]</span></h5></li>
<li>
<h5><span class="tsd-kind-parameter">options</span>: <a href="../interfaces/_truffle_encoder.ResolveOptions.html" class="tsd-signature-type tsd-kind-interface">ResolveOptions</a><span class="tsd-signature-symbol"> = {}</span></h5></li></ul></div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/_truffle_encoder.TxAndAbi.html" class="tsd-signature-type tsd-kind-interface">TxAndAbi</a><span class="tsd-signature-symbol">></span></h4><p>An object with a <code>tx</code> field, holding the transaction options,
including the encoded <code>data</code>, and an <code>abi</code> field, indicating which
ABI entry was used for encoding.</p>
<div class="tsd-comment tsd-typography"><