Updating docs.
This commit is contained in:
parent
06cafe3437
commit
184c459fab
@ -4,18 +4,27 @@ _section: Addresses
|
||||
|
||||
Explain addresses,formats and checksumming here.
|
||||
|
||||
Also see: [Constants.AddressZero](constants)
|
||||
Also see: [constants.AddressZero](constants)
|
||||
|
||||
_heading: Functions
|
||||
|
||||
_property: utils.getAddress(address) => string
|
||||
TODO
|
||||
|
||||
_property: utils.isAddress(address) => boolean
|
||||
TODO
|
||||
_property: utils.getAddress(address) => string @<utils-getAddress> @TS<address:>
|
||||
Returns //address// as a Checksum Address.
|
||||
|
||||
_property: utils.getIcapAddress(address) => string
|
||||
TODO
|
||||
If //address// is an invalid 40-nibble [[hexstring]] or if it contains mixed case and
|
||||
the checksum is invalid, an InvalidArgument Error is throw.
|
||||
|
||||
_property: utils.getContractAddress(transaction) => string
|
||||
TODO
|
||||
The value of //address// may be any supported address format.
|
||||
|
||||
|
||||
_property: utils.isAddress(address) => boolean @<utils-isAddress> @TS<address:>
|
||||
Returns true if //address// is valid (in any supported format).
|
||||
|
||||
_property: utils.getIcapAddress(address) => string @<utils-getIcapAddress> @TS<address:>
|
||||
Returns //address// as an ICAP address. Supports the same restrictions as
|
||||
[utils.getAddress](utils-getAddress).
|
||||
|
||||
_property: utils.getContractAddress(transaction) => string @<utils-getContractAddress> @TS<address:>
|
||||
Returns the contract address that would result if //transaction// was
|
||||
used to deploy a contract.
|
||||
|
@ -8,20 +8,27 @@ _subsection: Types
|
||||
|
||||
_heading: Bytes @<bytes>
|
||||
|
||||
A Bytes object is any object which is an
|
||||
[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) or
|
||||
[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) with
|
||||
A **Bytes** is any object which is an
|
||||
[Array](https:/\/developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) or
|
||||
[TypedArray](https:/\/developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) with
|
||||
each value in the valid byte range (i.e. between 0 and 255 inclusive),
|
||||
or is an Object with a ``length`` property where each indexed property
|
||||
is in the valid byte range.
|
||||
|
||||
_heading: BytesLike @<byteslike>
|
||||
|
||||
A **BytesLike** can be either a [[bytes]] or a [[hexstring]].
|
||||
A **BytesLike** can be either a [[bytes]] or a [[datahexstring]].
|
||||
|
||||
_heading: DataHexstring @<datahexstring>
|
||||
|
||||
A **DataHexstring** is identical to a [[hexstring]] except that it has
|
||||
an even number of nibbles, and therefore is a valid representation of
|
||||
binary data as a string.
|
||||
|
||||
_heading: Hexstring @<hexstring>
|
||||
|
||||
A **hexstring** is a string which has a ``0x`` prefix followed by
|
||||
A **hexstring** is a string which has a ``0x`` prefix followed by any
|
||||
number of nibbles (i.e. case-insensitive hexidecumal characters, ``0-9`` and ``a-f``).
|
||||
|
||||
_heading: Signature @<signature>
|
||||
|
||||
@ -35,37 +42,36 @@ _heading: SignatureLike @<signaturelike>
|
||||
A **SignatureLike** is similar to a [[signature]], except redundant properties
|
||||
may be omitted.
|
||||
|
||||
For example, if *_vs* is specified, **(r, s)** and **v** can be omitted. Likewise,
|
||||
if **recoverParam** is provided, **v** can be omitted (as it can be computed).
|
||||
For example, if **_vs** is specified, **s** and **v** may be omitted. Likewise,
|
||||
if **recoveryParam** is provided, **v** may be omitted (as in these cases the
|
||||
missing values can be computed).
|
||||
|
||||
|
||||
_subsection: Inspection
|
||||
|
||||
_property: utils.isBytes(object) => boolean
|
||||
_property: utils.isBytes(object) => boolean @<utils-isbytes> @TS<bytes:>
|
||||
Returns true if and only if //object// is a valid [[bytes]].
|
||||
|
||||
_property: utils.isBytesLike(object) => boolean
|
||||
Returns true if and only if //object// is a [[bytes]] or an Array or TypedArray
|
||||
where each value is a valid byte (i.e. between 0 and 255 inclusive).
|
||||
_property: utils.isBytesLike(object) => boolean @<utils-isbyteslike> @TS<bytes:>
|
||||
Returns true if and only if //object// is a [[bytes]] or [[datahexstring]].
|
||||
|
||||
_property: utils.isHexString(object, [ length ] ) => boolean
|
||||
Returns true if and only if //object// is a valid hex string;
|
||||
if //length// is specified the length (in bytes) is also verified.
|
||||
_property: utils.isHexString(object, [ length ] ) => boolean @<utils-ishexstring> @TS<bytes:>
|
||||
Returns true if and only if //object// is a valid hex string.
|
||||
If //length// is specified and //object// is not a valid [[datahexstring]] of
|
||||
//length// bytes, an InvalidArgument error is thrown.
|
||||
|
||||
|
||||
_subsection: Converting between Arrays and Hexstrings
|
||||
|
||||
_property: utils.arrayify(hexstringOrArrayish [ , options ]) => Uint8Array
|
||||
Converts //hexstringOrArrayish// to a Uint8Array. If a [[hexstring]]
|
||||
is passed in, the length must be even.
|
||||
_property: utils.arrayify(datahexstringOrArrayish [ , options ]) => Uint8Array @<utils-arrayify> @TS<bytes:>
|
||||
Converts //datahexstringOrArrayish// to a Uint8Array.
|
||||
|
||||
_property: utils.hexlify(hexstringOrArrayish) => string
|
||||
Converts //hexstringOrArrayish// to a [[hexstring]]. The result
|
||||
will always be zero-padded to even length.
|
||||
_property: utils.hexlify(hexstringOrArrayish) => string @<utils-hexlify> @TS<bytes:>
|
||||
Converts //hexstringOrArrayish// to a [[datahexstring]].
|
||||
|
||||
_property: utils.hexValue(aBigNumberish) => string
|
||||
Converts //aBigNumberish// to a [[hexstring]], with no unecessary leading
|
||||
zeros. The result of this function can be of odd-length.
|
||||
_property: utils.hexValue(aBigNumberish) => string @<utils-hexvalue> @TS<bytes:>
|
||||
Converts //aBigNumberish// to a [[hexstring]], with no __unnecessary__ leading
|
||||
zeros.
|
||||
|
||||
_heading: Examples
|
||||
|
||||
@ -74,48 +80,51 @@ _code: bytes-conversion.js
|
||||
|
||||
_subsection: Array Manipulation
|
||||
|
||||
_property: utils.concat(arrayOfBytesLike) => Uint8Array
|
||||
Concatenates all the [[byteslike]] in //arrayOfBytesLike//
|
||||
into a single Uint8Array.
|
||||
_property: utils.concat(arrayOfBytesLike) => Uint8Array @<utils-concat> @TS<bytes:>
|
||||
Concatenates all the [[byteslike]] in //arrayOfBytesLike// into a single Uint8Array.
|
||||
|
||||
_property: utils.stripZeros(aBytesLike) => Uint8Array
|
||||
Concatenates all the [[byteslike]] in //arrayOfBytesLike//
|
||||
_property: utils.stripZeros(aBytesLike) => Uint8Array @<utils-stripzeros> @TS<bytes:>
|
||||
Returns a Uint8Array with all leading ``0`` bytes of //aBtyesLike// removed.
|
||||
|
||||
_property: utils.zeroPad(aBytesLike, length) => Uint8Array
|
||||
Concatenates all the [[byteslike]] in //arrayOfBytesLike//
|
||||
_property: utils.zeroPad(aBytesLike, length) => Uint8Array @<utils-zeropad> @TS<bytes:>
|
||||
Retutns a Uint8Array of the data in //aBytesLike// with ``0`` bytes prepended to
|
||||
//length// bytes long.
|
||||
|
||||
If //aBytesLike// is already longer than //length// bytes long, an InvalidArgument
|
||||
error will be thrown.
|
||||
|
||||
|
||||
_subsection: Hexstring Manipulation
|
||||
|
||||
_property: utils.hexConcat(arrayOfBytesLike) => string
|
||||
Concatenates all the [[byteslike]] in //arrayOfBytesLike//
|
||||
into a single [[hexstring]]
|
||||
_property: utils.hexConcat(arrayOfBytesLike) => [[datahexstring]] @<utils-hexconcat> @TS<bytes:>
|
||||
Concatenates all the [[byteslike]] in //arrayOfBytesLike// into a single [[datahexstring]]
|
||||
|
||||
_property: utils.hexDataLength(aBytesLike) => number
|
||||
_property: utils.hexDataLength(aBytesLike) => [[datahexstring]] @<utils-hexdatalength> @TS<bytes:>
|
||||
Returns the length (in bytes) of //aBytesLike//.
|
||||
|
||||
This will **throw and error** if //aBytesLike// is a [[hexstring]]
|
||||
but is of odd-length.
|
||||
_property: utils.hexDataSlice(aBytesLike, offset [ , endOffset ] ) => [[datahexstring]] @<utils-hexdataslice> @TS<bytes:>
|
||||
Returns a [[datahexstring]] representation of a slice of //aBytesLike//, from
|
||||
//offset// (in bytes) to //endOffset// (in bytes). If //endOffset// is
|
||||
omitted, the length of //aBytesLike// is used.
|
||||
|
||||
_property: utils.hexDataSlice(aBytesLike, offset [ , endOffset ] ) => string
|
||||
Returns the length (in bytes) of //aBytesLike//.
|
||||
_property: utils.hexStripZeros(aBytesLike) => [[hexstring]] @<utils-hexstripzeros> @TS<bytes:>
|
||||
Returns a [[hexstring]] representation of //aBytesLike// with all
|
||||
leading zeros removed.
|
||||
|
||||
_property: utils.hexStripZeros(aBytesLike) => string
|
||||
@TODO
|
||||
_property: utils.hexZeroPad(aBytesLike, length) => [[datahexstring]] @<utils-hexzeropad> @TS<bytes:>
|
||||
Returns a [[datahexstring]] representation of //aBytesLike// padded to //length// bytes.
|
||||
|
||||
_property: utils.hexZeroPad(aBytesLike, length) => string
|
||||
@TODO
|
||||
If //aBytesLike// is already longer than //length// bytes long, an InvalidArgument
|
||||
error will be thrown.
|
||||
|
||||
|
||||
_subsection: Signature Conversion
|
||||
|
||||
_property: utils.joinSignature(aSignatureLike) => string
|
||||
Return the flat-format of a [[signaturelike]], which is
|
||||
65 bytes (130 nibbles) long, concatenating the **r**, **s** and **v**
|
||||
of a Signature.
|
||||
_property: utils.joinSignature(aSignatureLike) => [[datahexstring]] @<utils-joinsignature> @TS<bytes:>
|
||||
Return the flat-format of //aSignaturelike//, which is 65 bytes (130 nibbles)
|
||||
long, concatenating the **r**, **s** and (normalized) **v** of a Signature.
|
||||
|
||||
_property: utils.splitSignature(aSignatureLikeOrBytesLike) => Signature
|
||||
Return the full expanded-format of a [[signaturelike]] or
|
||||
a flat-format [[hexstring]]. Any missing properties will be
|
||||
computed.
|
||||
_property: utils.splitSignature(aSignatureLikeOrBytesLike) => [[signature]] @<utils-splitsignature> @TS<bytes:>
|
||||
Return the full expanded-format of //aSignaturelike// or a flat-format [[datahexstring]].
|
||||
Any missing properties will be computed.
|
||||
|
||||
|
@ -11,38 +11,38 @@ _code: constants-import.js
|
||||
|
||||
_subsection: Bytes
|
||||
|
||||
_property: constants.AddressZero
|
||||
_property: constants.AddressZero => [[datahexstring]] @<constants-addresszero> @TS<constants:>
|
||||
The Address Zero, which is 20 bytes (40 nibbles) of zero.
|
||||
|
||||
_property: constants.HashZero
|
||||
_property: constants.HashZero => [[datahexstring]] @<constants-hashzero> @TS<constants:>
|
||||
The Hash Zero, which is 32 bytes (64 nibbles) of zero.
|
||||
|
||||
|
||||
_subsection: Strings
|
||||
|
||||
_property: constants.EtherSymbol
|
||||
_property: constants.EtherSymbol => string @<constants-ethersymbol> @TS<constants:>
|
||||
The Ether symbol, **Ξ**.
|
||||
|
||||
|
||||
_subsection: BigNumber
|
||||
|
||||
_property: constants.NegativeOne
|
||||
_property: constants.NegativeOne => [[bignumber]] @<constants-negativeone> @TS<constants:>
|
||||
The BigNumber value representing ``"-1"``.
|
||||
|
||||
_property: constants.Zero
|
||||
_property: constants.Zero => [[bignumber]] @<constants-zero> @TS<constants:>
|
||||
The BigNumber value representing ``"0"``.
|
||||
|
||||
_property: constants.One
|
||||
_property: constants.One => [[bignumber]] @<constants-one> @TS<constants:>
|
||||
The BigNumber value representing ``"1"``.
|
||||
|
||||
_property: constants.Two
|
||||
_property: constants.Two => [[bignumber]] @<constants-two> @TS<constants:>
|
||||
The BigNumber value representing ``"2"``.
|
||||
|
||||
_property: constants.WeiPerEther
|
||||
_property: constants.WeiPerEther => [[bignumber]] @<constants-weiperether> @TS<constants:>
|
||||
The BigNumber value representing ``"1000000000000000000"``, which is the
|
||||
number of Wei per Ether.
|
||||
|
||||
_property: constants.MaxUint256
|
||||
_property: constants.MaxUint256 => [[bignumber]] @<constants-maxuint256> @TS<constants:>
|
||||
The BigNumber value representing the maximum ``uint256`` value.
|
||||
|
||||
|
||||
|
@ -46,23 +46,23 @@ _subsection: Functions
|
||||
|
||||
_heading: Formatting
|
||||
|
||||
_property: utils.commify(value) => string
|
||||
_property: utils.commify(value) => string @<util-commify> @TS<units:>
|
||||
Returns a string with value grouped by 3 digits, separated by ``,``.
|
||||
|
||||
|
||||
_heading: Conversion @<unit-conversion>
|
||||
|
||||
_property: utils.formatUnits(value [ , unit = "ether" ] ) => string
|
||||
_property: utils.formatUnits(value [ , unit = "ether" ] ) => string @<util-formatunits> @TS<units:>
|
||||
Returns a string representation of //value// formatted with //unit//
|
||||
digits (if it is a number) or to the unit specified (if a string).
|
||||
|
||||
_property: utils.formatEther(value) => string
|
||||
_property: utils.formatEther(value) => string @<util-formatether> @TS<units:>
|
||||
The equivalent to calling ``formatUnits(value, "ether")``.
|
||||
|
||||
_property: utils.parseUnits(value [ , unit = "ether" ] ) => [BigNumber](bignumber)
|
||||
_property: utils.parseUnits(value [ , unit = "ether" ] ) => [BigNumber](bignumber) @<util-parseunits> @TS<units:>
|
||||
Returns a [BigNumber](bignumber) representation of //value//, parsed with
|
||||
//unit// digits (if it is a number) or from the unit specified (if
|
||||
a string).
|
||||
|
||||
_property: utils.parseEther(value) => [BigNumber](bignumber)
|
||||
_property: utils.parseEther(value) => [BigNumber](bignumber) @<util-parseether> @TS<units:>
|
||||
The equivalent to calling ``parseUnits(value, "ether")``.
|
||||
|
@ -10,43 +10,43 @@ _subsection: Cryptographic Hashing
|
||||
The [Cryptographic Hash Functions](https://en.wikipedia.org/wiki/Cryptographic_hash_function)
|
||||
are a specific family of hash functions.
|
||||
|
||||
_property: utils.keccak256(aBytesLike) => string
|
||||
_property: utils.keccak256(aBytesLike) => [[datahexstring]] @<utils-keccak256> @TS<keccak256:>
|
||||
Returns the [KECCAK256](https://en.wikipedia.org/wiki/SHA-3) digest //aBytesLike//.
|
||||
|
||||
_property: utils.ripemd160(aBytesLike) => string
|
||||
_property: utils.ripemd160(aBytesLike) => [[datahexstring]] @<utils-ripemd160> @TS<sha2:>
|
||||
Returns the [RIPEMD-160](https://en.m.wikipedia.org/wiki/RIPEMD) digest of //aBytesLike//.
|
||||
|
||||
_property: utils.sha256(aBytesLike) => string
|
||||
_property: utils.sha256(aBytesLike) => [[datahexstring]] @<utils-sha256> @TS<sha2:>
|
||||
Returns the [SHA2-256](https://en.wikipedia.org/wiki/SHA-2) digest of //aBytesLike//.
|
||||
|
||||
_property: utils.sha512(aBytesLike) => string
|
||||
_property: utils.sha512(aBytesLike) => [[datahexstring]] @<utils-sha512> @TS<sha2:>
|
||||
Returns the [SHA2-512](https://en.wikipedia.org/wiki/SHA-2) digest of //aBytesLike//.
|
||||
|
||||
_property: utils.computeHmac(algorithm, key, data) => string
|
||||
_property: utils.computeHmac(algorithm, key, data) => [[datahexstring]] @<utils-computehmac> @TS<sha2:>
|
||||
Returns the [HMAC](https://en.wikipedia.org/wiki/HMAC) of //data// with //key//
|
||||
using the [Algorithm](supported-algorithm) //algorithm//.
|
||||
|
||||
|
||||
_heading: HMAC Supported Algorithms @<supported-algorithm>
|
||||
|
||||
_property: utils.SupportedAlgorithms.sha256
|
||||
_property: utils.SupportedAlgorithms.sha256 => string
|
||||
Use the [SHA2-256](https://en.wikipedia.org/wiki/SHA-2) hash algorithm.
|
||||
|
||||
_property: utils.SupportedAlgorithms.sha512
|
||||
_property: utils.SupportedAlgorithms.sha512 => string
|
||||
Use the [SHA2-512](https://en.wikipedia.org/wiki/SHA-2) hash algorithm.
|
||||
|
||||
|
||||
_subsection: Common Hashing Helpers
|
||||
|
||||
_property: utils.hashMessage(message) => string
|
||||
_property: utils.hashMessage(message) => [[datahexstring]] @<utils-hashmessage> @TS<hash:>
|
||||
Computes the Ethereum message digest of //message//. Ethereum messages are
|
||||
converted to UTF-8 bytes and prefixed with ``\x19Ethereum Signed Message:``
|
||||
and the length of //message//.
|
||||
|
||||
_property: utils.id(text) => string
|
||||
_property: utils.id(text) => [[datahexstring]] @<utils-id> @TS<hash:>
|
||||
The Ethereum Identity function computs the keccak256 hash of the //text// bytes.
|
||||
|
||||
_property: utils.namehash(name) => string
|
||||
_property: utils.namehash(name) => [[datahexstring]] @<utils-namehash> @TS<hash:>
|
||||
Returns the [ENS Namehash](https://docs.ens.domains/contract-api-reference/name-processing#hashing-names) of //name//.
|
||||
|
||||
|
||||
@ -56,15 +56,15 @@ When using the Solidity ``abi.packEncoded(...)`` function, a non-standard
|
||||
//tightly packed// version of encoding is used. These functions implement
|
||||
the tightly packing algorithm.
|
||||
|
||||
_property: utils.solidityPack(arrayOfTypes, arrayOfValues) => string
|
||||
_property: utils.solidityPack(arrayOfTypes, arrayOfValues) => [[datahexstring]] @<utils-soliditypack> @TS<solidity:pack()>
|
||||
Returns the non-standard encoded //arrayOfValues// packed according to
|
||||
their respecive type in //arrayOfTypes//.
|
||||
|
||||
_property: utils.solidityKeccak256(arrayOfTypes, arrayOfValues) => string
|
||||
_property: utils.solidityKeccak256(arrayOfTypes, arrayOfValues) => [[datahexstring]] @<utils-soliditykeccak256> @TS<solidity:keccak256()>
|
||||
Returns the KECCAK256 of the non-standard encoded //arrayOfValues// packed
|
||||
according to their respective type in //arrayOfTypes//.
|
||||
|
||||
_property: utils.soliditySha256(arrayOfTypes, arrayOfValues) => string
|
||||
_property: utils.soliditySha256(arrayOfTypes, arrayOfValues) => [[datahexstring]] @<utils-soliditysha256> @TS<solidity:sha256()>
|
||||
Returns the SHA2-256 of the non-standard encoded //arrayOfValues// packed
|
||||
according to their respective type in //arrayOfTypes//.
|
||||
|
||||
|
@ -17,25 +17,25 @@ single word (32 bytes). Since we need only a single byte for the
|
||||
null termination, we can store strings up to 31 bytes long in a
|
||||
word.
|
||||
|
||||
_definition: **Note:**
|
||||
_note: Note
|
||||
Strings that are 31 __//bytes//__ long may contain fewer than 31 __//characters//__,
|
||||
since UTF-8 requires multiple bytes to encode international characters.
|
||||
|
||||
_property: utils.parseBytes32String(aBytesLike) => string
|
||||
_property: utils.parseBytes32String(aBytesLike) => string @<utils-parsebytes32> @TS<strings:>
|
||||
Returns the decoded string represented by the ``Bytes32`` encoded data.
|
||||
|
||||
_property: utils.formatBytes32String(text) => string
|
||||
_property: utils.formatBytes32String(text) => string @<utils-formatbytes32> @TS<strings:>
|
||||
Returns a ``bytes32`` string representation of //text//. If the
|
||||
length of //text// exceeds 31 bytes, it will throw an error.
|
||||
|
||||
|
||||
_subsection: UTF-8 Strings @<utf8-string>
|
||||
|
||||
_property: utils.toUtf8Bytes(text [ , form = current ] ) => Uint8Array
|
||||
_property: utils.toUtf8Bytes(text [ , form = current ] ) => Uint8Array @<utils-toutf8bytes> @TS<strings:>
|
||||
Returns the UTF-8 bytes of //text//, optionally normalizing it using the
|
||||
[[unicode-normalization-form]] //form//.
|
||||
|
||||
_property: utils.toUtf8CodePoints(aBytesLike [ , form = current ] ) => Array<number>
|
||||
_property: utils.toUtf8CodePoints(aBytesLike [ , form = current ] ) => Array<number> @<utils-toutf8codepoints> @TS<strings:>
|
||||
Returns the Array of codepoints of //aBytesLike//, optionally normalizing it using the
|
||||
[[unicode-normalization-form]] //form//.
|
||||
|
||||
@ -44,7 +44,7 @@ its codepoint, accounting for surrogate pairs. This should not be confused with
|
||||
``string.split("")``, which destroys surrogate pairs, spliting between each UTF-16
|
||||
codeunit instead.
|
||||
|
||||
_property: utils.toUtf8String(aBytesLike [ , ignoreErrors = false ] ) => string
|
||||
_property: utils.toUtf8String(aBytesLike [ , ignoreErrors = false ] ) => string @<utils-toutf8string> @TS<strings:>
|
||||
Returns the string represented by the UTF-8 bytes of //aBytesLike//. This will
|
||||
throw an error for invalid surrogates, overlong sequences or other UTF-8 issues,
|
||||
unless //ignoreErrors// is specified.
|
||||
@ -86,7 +86,7 @@ _property: utils.UnicodeNormalizationForm.NFKD
|
||||
The Decomposed Normalization Form with Canonical Equivalence.
|
||||
See NFKC for more an example.
|
||||
|
||||
_definition: **Note:**
|
||||
_note: Note
|
||||
Only certain specified characters are folded in Canonical Equivalence, and thus
|
||||
it should not be considered a method to acheive //any// level of security from
|
||||
it should **not** be considered a method to acheive //any// level of security from
|
||||
[homoglyph attacks](https://en.wikipedia.org/wiki/IDN_homograph_attack).
|
||||
|
@ -3,3 +3,7 @@ _title: Events
|
||||
_section: Events
|
||||
|
||||
Explain how topics and such work
|
||||
|
||||
_subsection: Solidity Topics
|
||||
|
||||
How to compute the topic...
|
||||
|
@ -1,6 +1,8 @@
|
||||
_title: Gas
|
||||
|
||||
_section: Gas
|
||||
_section: Gas @<gas>
|
||||
|
||||
Explain attack vectors
|
||||
|
||||
_subsection: Gas Price @<gas-price>
|
||||
|
||||
@ -10,4 +12,3 @@ processed.
|
||||
|
||||
_subsection: Gas Limit @<gas-limit>
|
||||
|
||||
|
||||
|
@ -5,5 +5,11 @@
|
||||
"link": "https://docs-beta.ethers.io",
|
||||
"markdown": {
|
||||
"banner": "-----\n\nDocumentation: [html](https://docs-beta.ethers.io/)\n\n-----\n\n"
|
||||
},
|
||||
"source": {
|
||||
"path": "../packages/",
|
||||
"include": "packages/.*/src.ts/",
|
||||
"exclude": "/node_modules/|src.ts/.*browser.*",
|
||||
"link": "https://github.com/ethers-io/ethers.js/blob/ethers-v5-beta/packages$FILENAME#L$LINE"
|
||||
}
|
||||
}
|
||||
|
@ -20,4 +20,5 @@ _toc:
|
||||
|
||||
_null:
|
||||
This breaks out of a directive. For example, to end a
|
||||
|
||||
_definition and reset the indentation.
|
||||
|
@ -23,7 +23,7 @@ _code: importing-node.source
|
||||
_heading: Web Browser
|
||||
|
||||
It is generally better practice (for security reasons) to copy the
|
||||
[ethers library](https://cdn.ethers.io/lib/ethers-5.0.min.js) to
|
||||
[ethers library](https://cdn.ethers.io/lib/ethers-5.0.esm.min.js) to
|
||||
your own webserver and serve it yourself.
|
||||
|
||||
For quick demos or prototyping though, it can be loaded in your
|
||||
|
58
docs.wrm/hacking.wrm
Normal file
58
docs.wrm/hacking.wrm
Normal file
@ -0,0 +1,58 @@
|
||||
_title: Hacking
|
||||
|
||||
_section: Hacking
|
||||
|
||||
Things to keep in mind:
|
||||
|
||||
|
||||
_heading: Supported Platforms
|
||||
|
||||
...
|
||||
|
||||
_heading: Dependencies
|
||||
|
||||
Adding a dependency is non-trivial and will require fairly convincing
|
||||
arguments.
|
||||
|
||||
Further, **ALL** dependencies for ethers, **must** be MIT licensed or
|
||||
public domain (CC0).
|
||||
|
||||
All contributions to ethers are then included under the MIT license.
|
||||
|
||||
|
||||
_heading: Printable ASCII (7-bit) Characters
|
||||
|
||||
All source and documentation files should ONLY use the printable ASCII
|
||||
set.
|
||||
|
||||
This is for several reasons, bu...
|
||||
|
||||
- Transmission over certain HTTP servers and proxies can mangle
|
||||
UTF-8 data
|
||||
- Certain editors on some platforms, or in certain terminals cannot
|
||||
handle UTF-8 characters elegantly
|
||||
- The ability to enter non-ASCII characters on some platforms require
|
||||
special keyboards, input devices or input methods to be installed,
|
||||
which either not be supported, or may require administrative
|
||||
priviledges.
|
||||
|
||||
|
||||
_heading: License
|
||||
|
||||
MIT...
|
||||
|
||||
|
||||
_heading: Other Considerations
|
||||
|
||||
A common argument to Pull Requests is that they are simple, backwards compatible
|
||||
and
|
||||
|
||||
It is important to remember that a small change is something that
|
||||
we are required to support in perpetuity.
|
||||
|
||||
For example, adding support for an obscure platform, such as adding a dot-file
|
||||
to the root of the package, now carries the implication that we will continue
|
||||
keeping that dot-file up-to-date as new versions of that platform are released.
|
||||
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
<script src="https://cdn.ethers.io/lib/ethers-5.0.min.js"
|
||||
<script src="https://cdn.ethers.io/lib/ethers-5.0.esm.min.js"
|
||||
type="application/javascipt"></script>
|
||||
|
@ -45,6 +45,7 @@ Developer Documentation
|
||||
* [Importing](getting-started)
|
||||
* [Concepts](concepts)
|
||||
* [Events](concepts/events)
|
||||
* [Solidity Topics](concepts/events)
|
||||
* [Gas](concepts/gas)
|
||||
* [Gas Price](concepts/gas)
|
||||
* [Gas Limit](concepts/gas)
|
||||
@ -73,6 +74,7 @@ Developer Documentation
|
||||
* [InfuraProvider](api/providers/api-providers)
|
||||
* [NodesmithProvider](api/providers/api-providers)
|
||||
* [AlchemyProvider](api/providers/api-providers)
|
||||
* [CloudfrontProvider](api/providers/api-providers)
|
||||
* [Other Providers](api/providers/other)
|
||||
* [FallbackProvider](api/providers/other)
|
||||
* [IpcProvider](api/providers/other)
|
||||
@ -141,4 +143,4 @@ older versions of the library.
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 6abeb4fa3f15b3443d89a26a6b0320f602a12368bc5ebbfb14a6cce682836167
|
||||
**Content Hash:** f1da4df3feeb06a567657ae41d8498ea3315f68d05dc2f9e86c2858b5d2b2f89
|
@ -36,6 +36,7 @@ Here...
|
||||
* [InfuraProvider](providers/api-providers)
|
||||
* [NodesmithProvider](providers/api-providers)
|
||||
* [AlchemyProvider](providers/api-providers)
|
||||
* [CloudfrontProvider](providers/api-providers)
|
||||
* [Other Providers](providers/other)
|
||||
* [FallbackProvider](providers/other)
|
||||
* [IpcProvider](providers/other)
|
||||
@ -80,4 +81,4 @@ Here...
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** cbd0b8ac4ada4bfee211c0553ac53e171a6900127d874743a0dedf7fa30618f3
|
||||
**Content Hash:** 82f760f38f47d32016d3fca512c5dc75539d885d13138f1faa15f4be82edf8aa
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -73,6 +73,7 @@ Provider Documentation
|
||||
* [InfuraProvider](api-providers)
|
||||
* [NodesmithProvider](api-providers)
|
||||
* [AlchemyProvider](api-providers)
|
||||
* [CloudfrontProvider](api-providers)
|
||||
* [Other Providers](other)
|
||||
* [FallbackProvider](other)
|
||||
* [IpcProvider](other)
|
||||
@ -84,4 +85,4 @@ Provider Documentation
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** b15d8a2febb07abbbd784242c47575fbbb097f24643997ce30625c2e88adb095
|
||||
**Content Hash:** 4bae65aa1521a7ecf045f950c9a702ad597d83095d079e66a5abbd327373877c
|
@ -24,30 +24,58 @@ EtherscanProvider
|
||||
-----------------
|
||||
|
||||
|
||||
Tra la la...
|
||||
The **EtherscanProvider** is backed by a combination of the various
|
||||
[Etherscan APIs](https://etherscan.io/apis).
|
||||
|
||||
|
||||
#### *provider* . **getHistory** ( address ) **=>** *Array< History >*
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
InfuraProvider
|
||||
--------------
|
||||
|
||||
|
||||
Tra la la...
|
||||
The **InfuraProvider** is backed by the popular [INFURA](https://infura.io)
|
||||
Ethereum service.
|
||||
|
||||
It supports Mainnet (homestead) and all common testnets (Ropsten, Rinkeby,
|
||||
Görli and Kovan).
|
||||
|
||||
|
||||
NodesmithProvider
|
||||
-----------------
|
||||
|
||||
|
||||
Tra la la...
|
||||
The **NodesmithProvider** is backed by [Nodesmith](https://nodesmith.io).
|
||||
|
||||
It supports Mainnet (homestead) and all common testnets (Ropsten, Rinkeby,
|
||||
Görli and Kovan), as well as the Ethereum-like network [Aion](https://aion.network).
|
||||
|
||||
|
||||
AlchemyProvider
|
||||
---------------
|
||||
|
||||
|
||||
Tra la la...
|
||||
The **AlchemtProvider** is backed by [Alchemy](https://alchemyapi.io).
|
||||
|
||||
It supports Mainnet (homestead) and all common testnets (Ropsten, Rinkeby,
|
||||
Görli and Kovan).
|
||||
|
||||
|
||||
CloudfrontProvider
|
||||
------------------
|
||||
|
||||
|
||||
The CloudfrontProvider is backed by the
|
||||
[Cloudflare Ethereum Gateway](https://developers.cloudflare.com/distributed-web/ethereum-gateway/).
|
||||
|
||||
It only supports Mainnet (homestead).
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 9669eaaa1c2e9a31256fdd49e1b7f79550f064056b1bfd67a8cef6c7b5f8d473
|
||||
**Content Hash:** 2e1dfa80bd4ab1ba02610654b00ee4250a89758a496670822e7950d5db449b1c
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -17,7 +17,7 @@ Signer
|
||||
|
||||
|
||||
|
||||
#### *signer* . **connect** ( provider ) **=>** *Signer*
|
||||
#### *signer* . **connect** ( provider ) **=>** *[Signer](./)*
|
||||
|
||||
TODO
|
||||
|
||||
@ -28,14 +28,14 @@ TODO
|
||||
|
||||
|
||||
|
||||
#### *signer* . **getBalance** ( [ blockTag="latest" ] ) **=>** *Promise(BigNumber)*
|
||||
#### *signer* . **getBalance** ( [ blockTag="latest" ] ) **=>** *Promise< [BigNumber](../utils/bignumber) >*
|
||||
|
||||
TODO
|
||||
|
||||
|
||||
|
||||
|
||||
#### *signer* . **getTransactionCount** ( [ blockTag="latest" ] ) **=>** *Promise(number)*
|
||||
#### *signer* . **getTransactionCount** ( [ blockTag="latest" ] ) **=>** *Promise< number >*
|
||||
|
||||
TODO
|
||||
|
||||
@ -46,7 +46,8 @@ Wallet inherits Signer
|
||||
----------------------
|
||||
|
||||
|
||||
Wallet is...
|
||||
The Wallet class inherits [Signer](./) and can sign transactions and messages
|
||||
using a private key as a standard Externally Owned Account (EOA).
|
||||
|
||||
|
||||
### Creating an Instance
|
||||
@ -69,4 +70,4 @@ TODO
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 08ec198fa4ab407a1bed0a705073d7f40a6c3969b8e922961939fd8e009ca1ed
|
||||
**Content Hash:** 62c0d9640e683e41970dc1c779bd3b59ed08c27d99e15f6b51e7bae31ac1975e
|
File diff suppressed because one or more lines are too long
@ -11,7 +11,7 @@ Addresses
|
||||
|
||||
Explain addresses,formats and checksumming here.
|
||||
|
||||
Also see: [Constants.AddressZero](../constants)
|
||||
Also see: [constants.AddressZero](../constants)
|
||||
|
||||
|
||||
### Functions
|
||||
@ -20,32 +20,39 @@ Also see: [Constants.AddressZero](../constants)
|
||||
|
||||
#### *utils* . **getAddress** ( address ) **=>** *string*
|
||||
|
||||
TODO
|
||||
Returns *address* as a Checksum Address.
|
||||
|
||||
If *address* is an invalid 40-nibble [Hexstring](../bytes) or if it contains mixed case and
|
||||
the checksum is invalid, an InvalidArgument Error is throw.
|
||||
|
||||
The value of *address* may be any supported address format.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *utils* . **isAddress** ( address ) **=>** *boolean*
|
||||
|
||||
TODO
|
||||
Returns true if *address* is valid (in any supported format).
|
||||
|
||||
|
||||
|
||||
|
||||
#### *utils* . **getIcapAddress** ( address ) **=>** *string*
|
||||
|
||||
TODO
|
||||
Returns *address* as an ICAP address. Supports the same restrictions as
|
||||
[utils.getAddress](./).
|
||||
|
||||
|
||||
|
||||
|
||||
#### *utils* . **getContractAddress** ( transaction ) **=>** *string*
|
||||
|
||||
TODO
|
||||
Returns the contract address that would result if *transaction* was
|
||||
used to deploy a contract.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 0e138a3fe39efa87749ebc8290d153f705d26e547a38b7dce5f4d85603264d24
|
||||
**Content Hash:** 2dd561245955594d7080796077503064181258304572112d320139ae2594f383
|
File diff suppressed because one or more lines are too long
@ -108,44 +108,7 @@ Returns an instance of a **BigNumber** for *aBigNumberish*.
|
||||
|
||||
|
||||
```javascript
|
||||
// From a decimal string...
|
||||
BigNumber.from("42")
|
||||
// { BigNumber: "42" }
|
||||
|
||||
// From a hexstring...
|
||||
BigNumber.from("0x2a")
|
||||
// { BigNumber: "42" }
|
||||
|
||||
// From a negative hexstring...
|
||||
BigNumber.from("-0x2a")
|
||||
// { BigNumber: "-42" }
|
||||
|
||||
// From an Array (or Uint8Array)...
|
||||
BigNumber.from([ 42 ])
|
||||
// { BigNumber: "42" }
|
||||
|
||||
// From an existing BigNumber...
|
||||
let one1 = constants.One;
|
||||
let one2 = BigNumber.from(one1)
|
||||
|
||||
one2
|
||||
// { BigNumber: "1" }
|
||||
|
||||
// ...which returns the same instance
|
||||
one1 === one2
|
||||
// true
|
||||
|
||||
// From a (safe) number...
|
||||
BigNumber.from(42)
|
||||
// { BigNumber: "42" }
|
||||
|
||||
// From a ES2015 BigInt... (only on platforms with BigInt support)
|
||||
BigNumber.from(42n)
|
||||
// { BigNumber: "42" }
|
||||
|
||||
// Numbers outside the safe range fail:
|
||||
BigNumber.from(Number.MAX_SAFE_INTEGER);
|
||||
// Error: overflow (fault="overflow", operation="BigNumber.from", value=9007199254740991, version=bignumber/5.0.0-beta.129)
|
||||
Skipping JavaScript Evaluation.
|
||||
```
|
||||
|
||||
|
||||
@ -223,9 +186,9 @@ the *bitcount* least significant bits set to zero.
|
||||
|
||||
|
||||
[Two's Complicment](https://en.wikipedia.org/wiki/Two%27s_complement)
|
||||
is a method used to encode and decode fixed-width values which can be
|
||||
positive or negative, without requiring a separate sign bit. Most users
|
||||
will not need to interact with these.
|
||||
is an elegant method used to encode and decode fixed-width signed values
|
||||
while efficiently preserving mathematic operations.
|
||||
Most users will not need to interact with these.
|
||||
|
||||
|
||||
#### *bignumber* . **fromTwos** ( bitwidth ) **=>** *[BigNumber](./)*
|
||||
@ -333,11 +296,7 @@ Returns true if and only if the *object* is a BigNumber object.
|
||||
|
||||
|
||||
```javascript
|
||||
let a = BigNumber.from(42);
|
||||
let b = BigNumber.from("91");
|
||||
|
||||
a.mul(b);
|
||||
// { BigNumber: "3822" }
|
||||
Skipping JavaScript Evaluation.
|
||||
```
|
||||
|
||||
|
||||
@ -369,8 +328,7 @@ To demonstrate how this may be an issue in your code, consider:
|
||||
|
||||
|
||||
```javascript
|
||||
(Number.MAX_SAFE_INTEGER + 2 - 2) == (Number.MAX_SAFE_INTEGER)
|
||||
// false
|
||||
Skipping JavaScript Evaluation.
|
||||
```
|
||||
|
||||
|
||||
@ -386,4 +344,4 @@ mathematical operations handled safely.
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 269c8464ff80c77316617cbfa4e9a195d742f829a23911fecf0bba16961f81ae
|
||||
**Content Hash:** 76be4f72801f0d772c1ebe1acff4c41f6d52ed96f603de4b168f12d099470273
|
File diff suppressed because one or more lines are too long
@ -20,7 +20,7 @@ Types
|
||||
### Bytes
|
||||
|
||||
|
||||
A Bytes object is any object which is an
|
||||
A **Bytes** is any object which is an
|
||||
[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) or
|
||||
[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) with
|
||||
each value in the valid byte range (i.e. between 0 and 255 inclusive),
|
||||
@ -31,13 +31,22 @@ is in the valid byte range.
|
||||
### BytesLike
|
||||
|
||||
|
||||
A **BytesLike** can be either a [Bytes](./) or a [Hexstring](./).
|
||||
A **BytesLike** can be either a [Bytes](./) or a [DataHexstring](./).
|
||||
|
||||
|
||||
### DataHexstring
|
||||
|
||||
|
||||
A **DataHexstring** is identical to a [Hexstring](./) except that it has
|
||||
an even number of nibbles, and therefore is a valid representation of
|
||||
binary data as a string.
|
||||
|
||||
|
||||
### Hexstring
|
||||
|
||||
|
||||
A **hexstring** is a string which has a `0x` prefix followed by
|
||||
A **hexstring** is a string which has a `0x` prefix followed by any
|
||||
number of nibbles (i.e. case-insensitive hexidecumal characters, `0-9` and `a-f`).
|
||||
|
||||
|
||||
### Signature
|
||||
@ -57,8 +66,9 @@ A **hexstring** is a string which has a `0x` prefix followed by
|
||||
A **SignatureLike** is similar to a [Signature](./), except redundant properties
|
||||
may be omitted.
|
||||
|
||||
For example, if *_vs* is specified, **(r, s)** and **v** can be omitted. Likewise,
|
||||
if **recoverParam** is provided, **v** can be omitted (as it can be computed).
|
||||
For example, if **_vs** is specified, **s** and **v** may be omitted. Likewise,
|
||||
if **recoveryParam** is provided, **v** may be omitted (as in these cases the
|
||||
missing values can be computed).
|
||||
|
||||
|
||||
Inspection
|
||||
@ -75,16 +85,16 @@ Returns true if and only if *object* is a valid [Bytes](./).
|
||||
|
||||
#### *utils* . **isBytesLike** ( object ) **=>** *boolean*
|
||||
|
||||
Returns true if and only if *object* is a [Bytes](./) or an Array or TypedArray
|
||||
where each value is a valid byte (i.e. between 0 and 255 inclusive).
|
||||
Returns true if and only if *object* is a [Bytes](./) or [DataHexstring](./).
|
||||
|
||||
|
||||
|
||||
|
||||
#### *utils* . **isHexString** ( object , [ length ] ) **=>** *boolean*
|
||||
|
||||
Returns true if and only if *object* is a valid hex string;
|
||||
if *length* is specified the length (in bytes) is also verified.
|
||||
Returns true if and only if *object* is a valid hex string.
|
||||
If *length* is specified and *object* is not a valid [DataHexstring](./) of
|
||||
*length* bytes, an InvalidArgument error is thrown.
|
||||
|
||||
|
||||
|
||||
@ -94,26 +104,24 @@ Converting between Arrays and Hexstrings
|
||||
|
||||
|
||||
|
||||
#### *utils* . **arrayify** ( hexstringOrArrayish [ , options ] ) **=>** *Uint8Array*
|
||||
#### *utils* . **arrayify** ( datahexstringOrArrayish [ , options ] ) **=>** *Uint8Array*
|
||||
|
||||
Converts *hexstringOrArrayish* to a Uint8Array. If a [Hexstring](./)
|
||||
is passed in, the length must be even.
|
||||
Converts *datahexstringOrArrayish* to a Uint8Array.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *utils* . **hexlify** ( hexstringOrArrayish ) **=>** *string*
|
||||
|
||||
Converts *hexstringOrArrayish* to a [Hexstring](./). The result
|
||||
will always be zero-padded to even length.
|
||||
Converts *hexstringOrArrayish* to a [DataHexstring](./).
|
||||
|
||||
|
||||
|
||||
|
||||
#### *utils* . **hexValue** ( aBigNumberish ) **=>** *string*
|
||||
|
||||
Converts *aBigNumberish* to a [Hexstring](./), with no unecessary leading
|
||||
zeros. The result of this function can be of odd-length.
|
||||
Converts *aBigNumberish* to a [Hexstring](./), with no *unnecessary* leading
|
||||
zeros.
|
||||
|
||||
|
||||
|
||||
@ -123,29 +131,7 @@ zeros. The result of this function can be of odd-length.
|
||||
|
||||
|
||||
```javascript
|
||||
// Convert a hexstring to a Uint8Array
|
||||
arrayify("0x1234")
|
||||
// [ 18, 52 ]
|
||||
|
||||
// Convert an Array to a hexstring
|
||||
hexlify([1, 2, 3, 4])
|
||||
// 0x01020304
|
||||
|
||||
// Convert an Object to a hexstring
|
||||
hexlify({ length: 2, "0": 1, "1": 2 })
|
||||
// 0x0102
|
||||
|
||||
// Convert an Array to a hexstring
|
||||
hexlify([ 1 ])
|
||||
// 0x01
|
||||
|
||||
// Convert a number to a stripped hex value
|
||||
hexValue(1)
|
||||
// 0x1
|
||||
|
||||
// Convert an Array to a stripped hex value
|
||||
hexValue([ 1, 2 ])
|
||||
// 0x102
|
||||
Skipping JavaScript Evaluation.
|
||||
```
|
||||
|
||||
|
||||
@ -157,22 +143,25 @@ Array Manipulation
|
||||
|
||||
#### *utils* . **concat** ( arrayOfBytesLike ) **=>** *Uint8Array*
|
||||
|
||||
Concatenates all the [BytesLike](./) in *arrayOfBytesLike*
|
||||
into a single Uint8Array.
|
||||
Concatenates all the [BytesLike](./) in *arrayOfBytesLike* into a single Uint8Array.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *utils* . **stripZeros** ( aBytesLike ) **=>** *Uint8Array*
|
||||
|
||||
Concatenates all the [BytesLike](./) in *arrayOfBytesLike*
|
||||
Returns a Uint8Array with all leading `0` bytes of *aBtyesLike* removed.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *utils* . **zeroPad** ( aBytesLike , length ) **=>** *Uint8Array*
|
||||
|
||||
Concatenates all the [BytesLike](./) in *arrayOfBytesLike*
|
||||
Retutns a Uint8Array of the data in *aBytesLike* with `0` bytes prepended to
|
||||
*length* bytes long.
|
||||
|
||||
If *aBytesLike* is already longer than *length* bytes long, an InvalidArgument
|
||||
error will be thrown.
|
||||
|
||||
|
||||
|
||||
@ -182,41 +171,43 @@ Hexstring Manipulation
|
||||
|
||||
|
||||
|
||||
#### *utils* . **hexConcat** ( arrayOfBytesLike ) **=>** *string*
|
||||
#### *utils* . **hexConcat** ( arrayOfBytesLike ) **=>** *[DataHexstring](./)*
|
||||
|
||||
Concatenates all the [BytesLike](./) in *arrayOfBytesLike*
|
||||
into a single [Hexstring](./)
|
||||
Concatenates all the [BytesLike](./) in *arrayOfBytesLike* into a single [DataHexstring](./)
|
||||
|
||||
|
||||
|
||||
|
||||
#### *utils* . **hexDataLength** ( aBytesLike ) **=>** *number*
|
||||
|
||||
Returns the length (in bytes) of *aBytesLike*.
|
||||
|
||||
This will **throw and error** if *aBytesLike* is a [Hexstring](./)
|
||||
but is of odd-length.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *utils* . **hexDataSlice** ( aBytesLike , offset [ , endOffset ] ) **=>** *string*
|
||||
#### *utils* . **hexDataLength** ( aBytesLike ) **=>** *[DataHexstring](./)*
|
||||
|
||||
Returns the length (in bytes) of *aBytesLike*.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *utils* . **hexStripZeros** ( aBytesLike ) **=>** *string*
|
||||
#### *utils* . **hexDataSlice** ( aBytesLike , offset [ , endOffset ] ) **=>** *[DataHexstring](./)*
|
||||
|
||||
@TODO
|
||||
Returns a [DataHexstring](./) representation of a slice of *aBytesLike*, from
|
||||
*offset* (in bytes) to *endOffset* (in bytes). If *endOffset* is
|
||||
omitted, the length of *aBytesLike* is used.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *utils* . **hexZeroPad** ( aBytesLike , length ) **=>** *string*
|
||||
#### *utils* . **hexStripZeros** ( aBytesLike ) **=>** *[Hexstring](./)*
|
||||
|
||||
@TODO
|
||||
Returns a [Hexstring](./) representation of *aBytesLike* with all
|
||||
leading zeros removed.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *utils* . **hexZeroPad** ( aBytesLike , length ) **=>** *[DataHexstring](./)*
|
||||
|
||||
Returns a [DataHexstring](./) representation of *aBytesLike* padded to *length* bytes.
|
||||
|
||||
If *aBytesLike* is already longer than *length* bytes long, an InvalidArgument
|
||||
error will be thrown.
|
||||
|
||||
|
||||
|
||||
@ -226,24 +217,22 @@ Signature Conversion
|
||||
|
||||
|
||||
|
||||
#### *utils* . **joinSignature** ( aSignatureLike ) **=>** *string*
|
||||
#### *utils* . **joinSignature** ( aSignatureLike ) **=>** *[DataHexstring](./)*
|
||||
|
||||
Return the flat-format of a [SignatureLike](./), which is
|
||||
65 bytes (130 nibbles) long, concatenating the **r**, **s** and **v**
|
||||
of a Signature.
|
||||
Return the flat-format of *aSignaturelike*, which is 65 bytes (130 nibbles)
|
||||
long, concatenating the **r**, **s** and (normalized) **v** of a Signature.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *utils* . **splitSignature** ( aSignatureLikeOrBytesLike ) **=>** *Signature*
|
||||
#### *utils* . **splitSignature** ( aSignatureLikeOrBytesLike ) **=>** *[Signature](./)*
|
||||
|
||||
Return the full expanded-format of a [SignatureLike](./) or
|
||||
a flat-format [Hexstring](./). Any missing properties will be
|
||||
computed.
|
||||
Return the full expanded-format of *aSignaturelike* or a flat-format [DataHexstring](./).
|
||||
Any missing properties will be computed.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 1e52066c61f8794d858f02fb8164b146c9379968b0e0ab90efeb2fe16831599f
|
||||
**Content Hash:** fce7a8c85402ef3d94ffe261157fa3e0644c5c5d0641d9de7820a9a798bcb6c7
|
File diff suppressed because one or more lines are too long
@ -17,8 +17,7 @@ The **ethers.contants** Object contains commonly used values.
|
||||
|
||||
|
||||
```javascript
|
||||
//const { constants } = require("ethers");
|
||||
// const { constants } = require("@ethersproject/constants");
|
||||
Skipping JavaScript Evaluation.
|
||||
```
|
||||
|
||||
|
||||
@ -28,14 +27,14 @@ Bytes
|
||||
|
||||
|
||||
|
||||
#### *constants* . **AddressZero**
|
||||
#### *constants* . **AddressZero** **=>** *[DataHexstring](../bytes)*
|
||||
|
||||
The Address Zero, which is 20 bytes (40 nibbles) of zero.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *constants* . **HashZero**
|
||||
#### *constants* . **HashZero** **=>** *[DataHexstring](../bytes)*
|
||||
|
||||
The Hash Zero, which is 32 bytes (64 nibbles) of zero.
|
||||
|
||||
@ -47,7 +46,7 @@ Strings
|
||||
|
||||
|
||||
|
||||
#### *constants* . **EtherSymbol**
|
||||
#### *constants* . **EtherSymbol** **=>** *string*
|
||||
|
||||
The Ether symbol, **Ξ**.
|
||||
|
||||
@ -59,35 +58,35 @@ BigNumber
|
||||
|
||||
|
||||
|
||||
#### *constants* . **NegativeOne**
|
||||
#### *constants* . **NegativeOne** **=>** *[BigNumber](../bignumber)*
|
||||
|
||||
The BigNumber value representing `"-1"`.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *constants* . **Zero**
|
||||
#### *constants* . **Zero** **=>** *[BigNumber](../bignumber)*
|
||||
|
||||
The BigNumber value representing `"0"`.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *constants* . **One**
|
||||
#### *constants* . **One** **=>** *[BigNumber](../bignumber)*
|
||||
|
||||
The BigNumber value representing `"1"`.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *constants* . **Two**
|
||||
#### *constants* . **Two** **=>** *[BigNumber](../bignumber)*
|
||||
|
||||
The BigNumber value representing `"2"`.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *constants* . **WeiPerEther**
|
||||
#### *constants* . **WeiPerEther** **=>** *[BigNumber](../bignumber)*
|
||||
|
||||
The BigNumber value representing `"1000000000000000000"`, which is the
|
||||
number of Wei per Ether.
|
||||
@ -95,7 +94,7 @@ number of Wei per Ether.
|
||||
|
||||
|
||||
|
||||
#### *constants* . **MaxUint256**
|
||||
#### *constants* . **MaxUint256** **=>** *[BigNumber](../bignumber)*
|
||||
|
||||
The BigNumber value representing the maximum `uint256` value.
|
||||
|
||||
@ -104,4 +103,4 @@ The BigNumber value representing the maximum `uint256` value.
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** a781a8990aec282632e70ebc003a711adf5bc7773243aed727fc37a0934097f7
|
||||
**Content Hash:** 11a9a2e37a2a553b79931caf5374bcd894edf343a897c4253ddeaf4d2f8e1213
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -20,35 +20,35 @@ The [Cryptographic Hash Functions](https://en.wikipedia.org/wiki/Cryptographic_h
|
||||
are a specific family of hash functions.
|
||||
|
||||
|
||||
#### *utils* . **keccak256** ( aBytesLike ) **=>** *string*
|
||||
#### *utils* . **keccak256** ( aBytesLike ) **=>** *[DataHexstring](../bytes)*
|
||||
|
||||
Returns the [KECCAK256](https://en.wikipedia.org/wiki/SHA-3) digest *aBytesLike*.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *utils* . **ripemd160** ( aBytesLike ) **=>** *string*
|
||||
#### *utils* . **ripemd160** ( aBytesLike ) **=>** *[DataHexstring](../bytes)*
|
||||
|
||||
Returns the [RIPEMD-160](https://en.m.wikipedia.org/wiki/RIPEMD) digest of *aBytesLike*.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *utils* . **sha256** ( aBytesLike ) **=>** *string*
|
||||
#### *utils* . **sha256** ( aBytesLike ) **=>** *[DataHexstring](../bytes)*
|
||||
|
||||
Returns the [SHA2-256](https://en.wikipedia.org/wiki/SHA-2) digest of *aBytesLike*.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *utils* . **sha512** ( aBytesLike ) **=>** *string*
|
||||
#### *utils* . **sha512** ( aBytesLike ) **=>** *[DataHexstring](../bytes)*
|
||||
|
||||
Returns the [SHA2-512](https://en.wikipedia.org/wiki/SHA-2) digest of *aBytesLike*.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *utils* . **computeHmac** ( algorithm , key , data ) **=>** *string*
|
||||
#### *utils* . **computeHmac** ( algorithm , key , data ) **=>** *[DataHexstring](../bytes)*
|
||||
|
||||
Returns the [HMAC](https://en.wikipedia.org/wiki/HMAC) of *data* with *key*
|
||||
using the [Algorithm](./) *algorithm*.
|
||||
@ -60,14 +60,14 @@ using the [Algorithm](./) *algorithm*.
|
||||
|
||||
|
||||
|
||||
#### *utils* . *SupportedAlgorithms* . **sha256**
|
||||
#### *utils* . *SupportedAlgorithms* . **sha256** **=>** *string*
|
||||
|
||||
Use the [SHA2-256](https://en.wikipedia.org/wiki/SHA-2) hash algorithm.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *utils* . *SupportedAlgorithms* . **sha512**
|
||||
#### *utils* . *SupportedAlgorithms* . **sha512** **=>** *string*
|
||||
|
||||
Use the [SHA2-512](https://en.wikipedia.org/wiki/SHA-2) hash algorithm.
|
||||
|
||||
@ -79,7 +79,7 @@ Common Hashing Helpers
|
||||
|
||||
|
||||
|
||||
#### *utils* . **hashMessage** ( message ) **=>** *string*
|
||||
#### *utils* . **hashMessage** ( message ) **=>** *[DataHexstring](../bytes)*
|
||||
|
||||
Computes the Ethereum message digest of *message*. Ethereum messages are
|
||||
converted to UTF-8 bytes and prefixed with `x19Ethereum Signed Message:`
|
||||
@ -88,14 +88,14 @@ and the length of *message*.
|
||||
|
||||
|
||||
|
||||
#### *utils* . **id** ( text ) **=>** *string*
|
||||
#### *utils* . **id** ( text ) **=>** *[DataHexstring](../bytes)*
|
||||
|
||||
The Ethereum Identity function computs the keccak256 hash of the *text* bytes.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *utils* . **namehash** ( name ) **=>** *string*
|
||||
#### *utils* . **namehash** ( name ) **=>** *[DataHexstring](../bytes)*
|
||||
|
||||
Returns the [ENS Namehash](https://docs.ens.domains/contract-api-reference/name-processing#hashing-names) of *name*.
|
||||
|
||||
@ -111,7 +111,7 @@ When using the Solidity `abi.packEncoded(...)` function, a non-standard
|
||||
the tightly packing algorithm.
|
||||
|
||||
|
||||
#### *utils* . **solidityPack** ( arrayOfTypes , arrayOfValues ) **=>** *string*
|
||||
#### *utils* . **solidityPack** ( arrayOfTypes , arrayOfValues ) **=>** *[DataHexstring](../bytes)*
|
||||
|
||||
Returns the non-standard encoded *arrayOfValues* packed according to
|
||||
their respecive type in *arrayOfTypes*.
|
||||
@ -119,7 +119,7 @@ their respecive type in *arrayOfTypes*.
|
||||
|
||||
|
||||
|
||||
#### *utils* . **solidityKeccak256** ( arrayOfTypes , arrayOfValues ) **=>** *string*
|
||||
#### *utils* . **solidityKeccak256** ( arrayOfTypes , arrayOfValues ) **=>** *[DataHexstring](../bytes)*
|
||||
|
||||
Returns the KECCAK256 of the non-standard encoded *arrayOfValues* packed
|
||||
according to their respective type in *arrayOfTypes*.
|
||||
@ -127,7 +127,7 @@ according to their respective type in *arrayOfTypes*.
|
||||
|
||||
|
||||
|
||||
#### *utils* . **soliditySha256** ( arrayOfTypes , arrayOfValues ) **=>** *string*
|
||||
#### *utils* . **soliditySha256** ( arrayOfTypes , arrayOfValues ) **=>** *[DataHexstring](../bytes)*
|
||||
|
||||
Returns the SHA2-256 of the non-standard encoded *arrayOfValues* packed
|
||||
according to their respective type in *arrayOfTypes*.
|
||||
@ -137,4 +137,4 @@ according to their respective type in *arrayOfTypes*.
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 65dd2158ef160da7be3291c8e7aac15df2de683869df9c31b8efdaa39551b3e4
|
||||
**Content Hash:** 53b7b2b1fe243aebd3d5ff29c578538d0d068b0ff60b3426f7208cbf9f13d312
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -27,7 +27,7 @@ null termination, we can store strings up to 31 bytes long in a
|
||||
word.
|
||||
|
||||
|
||||
#### **Note:**
|
||||
#### Note
|
||||
|
||||
Strings that are 31 **bytes** long may contain fewer than 31 **characters**,
|
||||
since UTF-8 requires multiple bytes to encode international characters.
|
||||
@ -143,10 +143,10 @@ See NFKC for more an example.
|
||||
|
||||
|
||||
|
||||
#### **Note:**
|
||||
#### Note
|
||||
|
||||
Only certain specified characters are folded in Canonical Equivalence, and thus
|
||||
it should not be considered a method to acheive *any* level of security from
|
||||
it should **not** be considered a method to acheive *any* level of security from
|
||||
[homoglyph attacks](https://en.wikipedia.org/wiki/IDN_homograph_attack).
|
||||
|
||||
|
||||
@ -154,4 +154,4 @@ it should not be considered a method to acheive *any* level of security from
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 74002cd3d9368872b5618f68967deac34a4d1aeafeeac6ddb5c1d06a450180c9
|
||||
**Content Hash:** e38fe18f76e58587f7ed1c4558a5b3ec177eee1a5e71b4c88fa6d496154fdd8a
|
File diff suppressed because one or more lines are too long
@ -14,6 +14,7 @@ which developers can make use of or should be aware of.
|
||||
|
||||
|
||||
* [Events](events)
|
||||
* [Solidity Topics](events)
|
||||
* [Gas](gas)
|
||||
* [Gas Price](gas)
|
||||
* [Gas Limit](gas)
|
||||
@ -21,4 +22,4 @@ which developers can make use of or should be aware of.
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** ad59f45600332d936821db1fa0d0eeabdab5b4f252e1e815de525b4d1b9a9a7b
|
||||
**Content Hash:** 1846ad5571101be31cf9617167b5cc53338c83c0fc9389da19c8dd9d4153558b
|
@ -12,6 +12,13 @@ Events
|
||||
Explain how topics and such work
|
||||
|
||||
|
||||
Solidity Topics
|
||||
---------------
|
||||
|
||||
|
||||
How to compute the topic...
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 4b045e823bf9863272ddb1c5a8460bc461de2ad262503dc27829b64b57344d46
|
||||
**Content Hash:** 1334c1751891f09ab9349dcc5b7e6705ef823cd7b15a18433c053c764c6b9042
|
File diff suppressed because one or more lines are too long
@ -9,6 +9,8 @@ Gas
|
||||
===
|
||||
|
||||
|
||||
Explain attack vectors
|
||||
|
||||
|
||||
Gas Price
|
||||
---------
|
||||
@ -26,4 +28,4 @@ Gas Limit
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 4cc3001196d861faac19ebc393e002ce9e6f24702b66bac62ef8f9185625b3dc
|
||||
**Content Hash:** 2805374ab42eae31d185e96ae9308f0661dc826d460b33005a86f62fc2f17703
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -149,6 +149,7 @@ _toc:
|
||||
|
||||
_null:
|
||||
This breaks out of a directive. For example, to end a
|
||||
|
||||
_definition and reset the indentation.
|
||||
```
|
||||
|
||||
@ -194,4 +195,4 @@ This is a self-titled link [[https://ethereumorg]] and this
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 6cc55a98e7a50c76c8b27fbc7aae97bebaf9355a40b9c44a568f2f7fd927da57
|
||||
**Content Hash:** 2d45e62661589ea3cdf50cc4da9faf63c33b7385840b31fddaf9d3cbe35d6015
|
File diff suppressed because one or more lines are too long
@ -50,7 +50,7 @@ const { ethers } = require("ethers");
|
||||
|
||||
|
||||
It is generally better practice (for security reasons) to copy the
|
||||
[ethers library](https://cdn.ethers.io/lib/ethers-5.0.min.js) to
|
||||
[ethers library](https://cdn.ethers.io/lib/ethers-5.0.esm.min.js) to
|
||||
your own webserver and serve it yourself.
|
||||
|
||||
For quick demos or prototyping though, it can be loaded in your
|
||||
@ -58,7 +58,7 @@ Web Applications from our CDN.
|
||||
|
||||
|
||||
```
|
||||
<script src="https://cdn.ethers.io/lib/ethers-5.0.min.js"
|
||||
<script src="https://cdn.ethers.io/lib/ethers-5.0.esm.min.js"
|
||||
type="application/javascipt"></script>
|
||||
```
|
||||
|
||||
@ -66,4 +66,4 @@ Web Applications from our CDN.
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 01b739e7d4410ec57652b8058ae7a5902107ce0b170ecd3550cbc97f4d287fd8
|
||||
**Content Hash:** a78889cf0b1215b8268f76e5cef5869b2b592e56a5ce062d58dfcc4f5b93159d
|
File diff suppressed because one or more lines are too long
70
docs/hacking/README.md
Normal file
70
docs/hacking/README.md
Normal file
@ -0,0 +1,70 @@
|
||||
-----
|
||||
|
||||
Documentation: [html](https://docs-beta.ethers.io/)
|
||||
|
||||
-----
|
||||
|
||||
|
||||
Hacking
|
||||
=======
|
||||
|
||||
|
||||
Things to keep in mind:
|
||||
|
||||
|
||||
### Supported Platforms
|
||||
|
||||
|
||||
...
|
||||
|
||||
|
||||
### Dependencies
|
||||
|
||||
|
||||
Adding a dependency is non-trivial and will require fairly convincing
|
||||
arguments.
|
||||
|
||||
Further, **ALL** dependencies for ethers, **must** be MIT licensed or
|
||||
public domain (CC0).
|
||||
|
||||
All contributions to ethers are then included under the MIT license.
|
||||
|
||||
|
||||
### Printable ASCII (7-bit) Characters
|
||||
|
||||
|
||||
All source and documentation files should ONLY use the printable ASCII
|
||||
set.
|
||||
|
||||
This is for several reasons, bu...
|
||||
|
||||
|
||||
|
||||
* Transmission over certain HTTP servers and proxies can mangle UTF-8 data
|
||||
* Certain editors on some platforms, or in certain terminals cannot handle UTF-8 characters elegantly
|
||||
* The ability to enter non-ASCII characters on some platforms require special keyboards, input devices or input methods to be installed, which either not be supported, or may require administrative priviledges.
|
||||
|
||||
|
||||
### License
|
||||
|
||||
|
||||
MIT...
|
||||
|
||||
|
||||
### Other Considerations
|
||||
|
||||
|
||||
A common argument to Pull Requests is that they are simple, backwards compatible
|
||||
and
|
||||
|
||||
It is important to remember that a small change is something that
|
||||
we are required to support in perpetuity.
|
||||
|
||||
For example, adding support for an obscure platform, such as adding a dot-file
|
||||
to the root of the package, now carries the implication that we will continue
|
||||
keeping that dot-file up-to-date as new versions of that platform are released.
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 55f49a4430f6cc2ae9ca51a5932a710217a99e253a57173223b869e4378ab8bd
|
13
docs/hacking/index.html
Normal file
13
docs/hacking/index.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
15
docs/static/link.svg
vendored
Normal file
15
docs/static/link.svg
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">
|
||||
<path d="M92.7,7.5C88,2.7,81.7,0.2,75,0.2c-6.7,0-13,2.6-17.7,7.3L35.2,29.6c-9.7,9.7-9.7,25.6,0,35.4c1.6,1.6,3.4,2.8,5.2,3.9
|
||||
l9.5-9.5c-2.2-0.5-4.2-1.6-5.9-3.3c-1.6-1.6-2.6-3.4-3.1-5.4v0c-0.2-0.7-0.3-1.4-0.4-2.1c0,0,0,0,0-0.1c-0.1-0.7-0.1-1.4,0-2.1
|
||||
c0-0.1,0-0.1,0-0.2c0.1-0.7,0.2-1.3,0.3-2c0-0.1,0-0.1,0-0.2c0.5-2.1,1.6-4,3.2-5.6l22.1-22.1c2.4-2.4,5.6-3.7,8.8-3.7
|
||||
c3.2,0,6.4,1.2,8.8,3.7c4.9,4.9,4.9,12.8,0,17.7l-7.7,7.7c0.2,0.5,0.3,1.1,0.5,1.6l0,0c0,0.1,0.1,0.3,0.1,0.4
|
||||
c1.1,3.5,1.5,7.1,1.3,10.7v0c0,0.2,0,0.4-0.1,0.5c-0.1,0.9-0.1,1.8-0.2,2.6l14.8-14.8C102.4,33.1,102.4,17.2,92.7,7.5z M59.5,31.2
|
||||
L50,40.7c2.1,0.5,4.2,1.6,5.9,3.3c1.6,1.6,2.6,3.4,3.1,5.4v0c0.2,0.7,0.3,1.4,0.4,2.1c0,0,0,0.1,0,0.1c0.1,0.7,0.1,1.4,0,2.1
|
||||
c0,0.1,0,0.1,0,0.2c-0.1,0.7-0.2,1.3-0.3,2c0,0.1,0,0.1-0.1,0.2c-0.6,2.1-1.6,4-3.2,5.6L33.8,83.7c-2.4,2.4-5.6,3.7-8.8,3.7
|
||||
s-6.4-1.2-8.8-3.7c-4.9-4.9-4.9-12.8,0-17.7l7.7-7.7c-0.2-0.5-0.3-1.1-0.5-1.6v0c0-0.1-0.1-0.3-0.1-0.4c-1.1-3.5-1.5-7.1-1.3-10.7
|
||||
c0,0,0,0,0,0c0-0.2,0-0.4,0-0.5c0.1-0.9,0.1-1.8,0.2-2.6L7.3,57.2c-9.7,9.7-9.7,25.6,0,35.4c4.7,4.7,11,7.3,17.7,7.3
|
||||
s13-2.6,17.7-7.3l22.1-22.1c9.7-9.7,9.7-25.6,0-35.4C63.2,33.5,61.4,32.3,59.5,31.2z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.5 KiB |
100
docs/static/style.css
vendored
100
docs/static/style.css
vendored
@ -312,6 +312,60 @@ div.breadcrumbs span.current {
|
||||
width: 800px;
|
||||
}
|
||||
|
||||
.show-anchors > div {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.show-anchors > div > .anchors {
|
||||
display: block;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.anchors a {
|
||||
height: 50px;
|
||||
position: absolute;
|
||||
line-height: 50px;
|
||||
pointer-events: auto;
|
||||
transition: opacity 0.3s linear;
|
||||
top: 50%;
|
||||
}
|
||||
|
||||
.anchors a.self {
|
||||
background: url(./link.svg) center no-repeat;
|
||||
left: -8px;
|
||||
opacity: 0;
|
||||
transform: translate(-100%, -50%);
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
.show-anchors:hover > div > .anchors a.self {
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
.show-anchors > div > .anchors a.self:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.anchors a.source {
|
||||
right: 0;
|
||||
opacity: 0.3;
|
||||
transform: translate(100%, -50%);
|
||||
}
|
||||
|
||||
.show-anchors:hover > div > .anchors a.source {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.anchors a.source:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.definition {
|
||||
margin: 10px 0 0 15px;
|
||||
padding: 10px 0 0 15px;
|
||||
@ -323,13 +377,53 @@ div.breadcrumbs span.current {
|
||||
|
||||
.definition .term {
|
||||
font-size: 110%;
|
||||
dddfont-weight: bold;
|
||||
}
|
||||
|
||||
.definition.container-box {
|
||||
border-radius: 5px;
|
||||
left: 15px;
|
||||
margin-bottom: 30px;
|
||||
margin-top: 30px;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
.definition.container-box .term {
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
padding: 5px 15px;
|
||||
}
|
||||
|
||||
.definition.container-box p {
|
||||
font-size: 16px;
|
||||
padding: 10px 30px;
|
||||
}
|
||||
|
||||
.definition.container-box.note {
|
||||
border: 2px solid #184e80;
|
||||
}
|
||||
|
||||
.definition.container-box.note .term {
|
||||
background-color: #65a9e9;
|
||||
ddd-border: 2px solid #184e80;
|
||||
}
|
||||
|
||||
|
||||
.definition.container-box.warning {
|
||||
border: 2px solid #804e18;
|
||||
}
|
||||
|
||||
.definition.container-box.warning .term {
|
||||
background-color: #cf7a00;
|
||||
}
|
||||
|
||||
|
||||
code.inline {
|
||||
background: #eef;
|
||||
dddpadding-left: 5px;
|
||||
dddpadding-right: 5px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.property {
|
||||
|
File diff suppressed because one or more lines are too long
@ -5,11 +5,8 @@ import { BigNumber } from "@ethersproject/bignumber";
|
||||
const AddressZero = "0x0000000000000000000000000000000000000000";
|
||||
const HashZero = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
||||
|
||||
// NFKD (decomposed)
|
||||
//const EtherSymbol = "\uD835\uDF63";
|
||||
|
||||
// NFKC (composed)
|
||||
const EtherSymbol = "\u039e";
|
||||
// NFKC (composed) // (decomposed)
|
||||
const EtherSymbol = "\u039e"; // "\uD835\uDF63";
|
||||
|
||||
const NegativeOne: BigNumber = BigNumber.from(-1);
|
||||
const Zero: BigNumber = BigNumber.from(0);
|
||||
|
Loading…
Reference in New Issue
Block a user