smartcontracts

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2022 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Detect smart contract properties

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAddressDetailFromBlockchain

func GetAddressDetailFromBlockchain(address string, client *ethclient.Client) (detail addressdetail.AddressDetail, found bool)

GetAddressDetailFromBlockchain tries to detect an ERC20 / ERC721 token or generic smart contract, and returns an addressdetail.AddressDetail with the received details.

func IsContract

func IsContract(address string, client *ethclient.Client) (isContract bool, err error)

func IsErc20

func IsErc20(address string, client *ethclient.Client) (isErc20 bool, detail addressdetail.AddressDetail, err error)

func IsErc721

func IsErc721(address string, client *ethclient.Client) (isErc721 bool, detail addressdetail.AddressDetail, err error)

TODO: Currently returns true for every SC that supports INTERFACEID_ERC165. It should really be INTERFACEID_ERC721, but that doesn't detect some SCs, eg. cryptokitties https://etherscan.io/address/0x06012c8cf97BEaD5deAe237070F9587f8E7A266d#readContract As a quick fix, just checks ERC165 and count it as ERC721 address. Improve with further/better SC method checks.

func SmartContractSupportsInterface

func SmartContractSupportsInterface(address string, interfaceId [4]byte, client *ethclient.Client) (supportsInterface bool, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL