DecodeTokenURI
DecodeTokenURI
stripped down version of https://github.com/MrChico/verifyIPFS/, refer to the original for more details
State Variables
ALPHABET
bytes constant ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";Functions
toBase58
Converts hex string to base 58
function toBase58(bytes memory source) internal pure returns (bytes memory);toAlphabet
function toAlphabet(uint8[] memory indices) private pure returns (bytes memory);truncate
function truncate(uint8[] memory array, uint8 length) private pure returns (uint8[] memory);reverse
EIP712
State Variables
_DOMAIN_SEPARATOR
_DOMAIN_TYPEHASH
keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"). Assembly access to immutable variables is not supported (needed in order to compute _DOMAIN_SEPARATOR) string version is not included in the domain separator, because it is only needed for upgradable contracts
_void
Functions
voidVouchers
voidVouchers allows the owner of the voucher to void it, so it cannot be used anymore. MUST be used in case the signer raises the price, or cancels the voucher
_hashTypedData
Returns the hash of the fully encoded EIP-712 message for this domain, given structHash, as defined in https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct. The hash can be used together with {ECDSA-recover} to obtain the signer of a message: bytes32 digest = _hashTypedData(keccak256(abi.encode( keccak256("Mail(address to,string contents)"), mailTo, keccak256(bytes(mailContents)) ))); address signer = ECDSA.recover(digest, signature);
eip712Domain
See: https://eips.ethereum.org/EIPS/eip-5267. The event EIP712DomainChanged is not implemented as the domain is not expected to change.
name
The binary representation 0b00001111 has the four least significant bits set to 1. This means the first four parameters of the domain are active or utilized. From the provided EIP-712 domain implementation, these parameters are: name, version, chainId, verifyingContract
_buildDomainSeparator
Returns the EIP-712 domain separator.
this function is usful for contracts that need to change the domain separator, see https://github.com/Vectorized/solady/blob/main/src/utils/EIP712.sol for details
initialize
Events
VoidVouchers
Last updated