Documentation ¶
Index ¶
- Variables
- func ContainsMethodIDs(code []byte, methodIDs ...[4]byte) bool
- func DetectERC1155WithCode(_ uint64, _ common.Address, code []byte) bool
- func DetectERC165WithCode(_ uint64, _ common.Address, code []byte) bool
- func DetectERC1967WithCode(_ uint64, _ common.Address, code []byte) bool
- func DetectERC20WithCode(_ uint64, address common.Address, code []byte) bool
- func DetectERC721WithCode(_ uint64, _ common.Address, code []byte) bool
- func DetectNFTStandard(ctx context.Context, _ uint64, address common.Address, blockNumber *big.Int, ...) (metadata.Standard, error)
- func DetectTokenStandard(ctx context.Context, chainID uint64, address common.Address, ...) (metadata.Standard, error)
- func EventHash(event string) common.Hash
- func MatchAddresses(address common.Address, addresses ...common.Address) bool
- func MatchEventHashes(hash common.Hash, eventHashes ...common.Hash) bool
- func MatchMethodIDs(input []byte, methodIDs ...[4]byte) bool
- func MethodID(method string) [4]byte
Constants ¶
This section is empty.
Variables ¶
var ( // InterfaceIDERC721 method ID from https://eips.ethereum.org/EIPS/eip-721#:~:text=0x80ac58cd. InterfaceIDERC721 = [4]byte(hexutil.MustDecode("0x80ac58cd")) // InterfaceIDERC1155 method ID from https://eips.ethereum.org/EIPS/eip-1155#:~:text=0xd9b67a26. InterfaceIDERC1155 = [4]byte(hexutil.MustDecode("0xd9b67a26")) )
Functions ¶
func ContainsMethodIDs ¶
ContainsMethodIDs checks if the code contains all the method IDs.
func DetectERC1155WithCode ¶
DetectERC1155WithCode detects if bytecode of the contract is ERC-1155.
func DetectERC165WithCode ¶
DetectERC165WithCode detects if bytecode of the contract is ERC-165.
func DetectERC1967WithCode ¶
DetectERC1967WithCode detects if bytecode of the contract is ERC-1967.
func DetectERC20WithCode ¶
DetectERC20WithCode detects if bytecode of the contract is ERC-20.
func DetectERC721WithCode ¶
DetectERC721WithCode detects if bytecode of the contract is ERC-721.
func DetectNFTStandard ¶
func DetectNFTStandard(ctx context.Context, _ uint64, address common.Address, blockNumber *big.Int, ethereumClient ethereum.Client) (metadata.Standard, error)
DetectNFTStandard detects the NFT standard of the contract by ERC-165.
func DetectTokenStandard ¶
func DetectTokenStandard(ctx context.Context, chainID uint64, address common.Address, blockNumber *big.Int, ethereumClient ethereum.Client) (metadata.Standard, error)
DetectTokenStandard detects the token standard of the contract by bytecode. It supports the ERC-1967 proxy contract.
func MatchAddresses ¶
MatchAddresses checks if the address matches any of the addresses.
func MatchEventHashes ¶
MatchEventHashes checks if the hash matches any of the event hashes.
func MatchMethodIDs ¶
MatchMethodIDs checks if the input matches any of the method IDs.
Types ¶
This section is empty.