eip

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package eip provides structures and functions to represent and manipulate Ethereum Improvement Proposals (EIPs) and Ethereum standards.

Package eip provides structures and functions related to Ethereum Improvement Proposals (EIPs).

Index

Constants

View Source
const (
	// HighConfidenceThreshold represents a high confidence threshold value.
	HighConfidenceThreshold ConfidenceThreshold = 0.9

	// MediumConfidenceThreshold represents a medium confidence threshold value.
	MediumConfidenceThreshold ConfidenceThreshold = 0.5

	// LowConfidenceThreshold represents a low confidence threshold value.
	LowConfidenceThreshold ConfidenceThreshold = 0.1

	// NoConfidenceThreshold represents no confidence threshold value.
	NoConfidenceThreshold ConfidenceThreshold = 0.0

	// HighConfidence represents a high confidence level.
	HighConfidence ConfidenceLevel = 3

	// MediumConfidence represents a medium confidence level.
	MediumConfidence ConfidenceLevel = 2

	// LowConfidence represents a low confidence level.
	LowConfidence ConfidenceLevel = 1

	// NoConfidence represents no confidence level.
	NoConfidence ConfidenceLevel = 0
)
View Source
const (
	// TypeString represents the Ethereum "string" data type.
	TypeString = "string"

	// TypeAddress represents the Ethereum "address" data type.
	TypeAddress = "address"

	// TypeUint256 represents the Ethereum "uint256" data type.
	TypeUint256 = "uint256"

	// TypeBool represents the Ethereum "bool" data type.
	TypeBool = "bool"

	// TypeBytes represents the Ethereum "bytes" data type.
	TypeBytes = "bytes"

	// TypeBytes32 represents the Ethereum "bytes32" data type.
	TypeBytes32 = "bytes32"

	// TypeAddressArray represents an array of Ethereum "address" data types.
	TypeAddressArray = "address[]"

	// TypeUint256Array represents an array of Ethereum "uint256" data types.
	TypeUint256Array = "uint256[]"
)

Constants representing common Ethereum data types.

Variables

This section is empty.

Functions

func CalculateDiscoveryConfidence

func CalculateDiscoveryConfidence(totalConfidence float64) (ConfidenceLevel, ConfidenceThreshold)

CalculateDiscoveryConfidence calculates the confidence level and threshold based on the total confidence.

func Exists

func Exists(s Standard) bool

Exists checks if a given Ethereum standard is registered in the storage.

Parameters: - s: The Ethereum standard type.

Returns: - bool: A boolean indicating if the standard exists in the storage.

func GetProtoStandardFromString

func GetProtoStandardFromString(s string) (eip_pb.Standard, error)

GetProtoStandardFromString converts a string representation of an Ethereum standard to its corresponding protobuf enum value. If the standard is not recognized, it returns an error.

Parameters: s: The string representation of the Ethereum standard.

Returns: - The corresponding protobuf enum value of the Ethereum standard. - An error if the standard is not recognized.

func GetRegisteredStandards

func GetRegisteredStandards() map[Standard]EIP

GetRegisteredStandards retrieves all the registered Ethereum standards from the storage.

Returns: - map[Standard]ContractStandard: A map of all registered Ethereum standards.

func LoadStandards

func LoadStandards() error

LoadStandards loads list of supported Ethereum EIPs into the registry.

func RegisterStandard

func RegisterStandard(s Standard, cs EIP) error

RegisterStandard registers a new Ethereum standard to the storage. If the standard already exists, it returns an error.

Parameters: - s: The Ethereum standard type. - cs: The details of the Ethereum standard.

Returns: - error: An error if the standard already exists, otherwise nil.

func StandardsLoaded

func StandardsLoaded() bool

StandardsLoaded returns a boolean indicating whether the storage has any registered Ethereum standards.

func ToJSON

func ToJSON(data interface{}) ([]byte, error)

ToJSON converts a Go struct to its JSON representation.

func ToJSONPretty

func ToJSONPretty(data interface{}) ([]byte, error)

ToJSONPretty returns a pretty-printed JSON representation of the provided interface. This function is primarily used for debugging purposes.

func ToProtoJSON

func ToProtoJSON(data interface{}) ([]byte, error)

ToProtoJSON converts a Go struct to its JSON representation.

func TokenCount

func TokenCount(cs ContractStandard) int

TokenCount calculates and returns the total number of tokens (inputs and outputs) present in the functions and events of a given ContractStandard.

func WriteToFile

func WriteToFile(path string, data []byte) error

WriteToFile writes the provided data byte array to a file at the provided path.

Types

type ConfidenceLevel

type ConfidenceLevel int

ConfidenceLevel represents the confidence level of a discovery.

func (ConfidenceLevel) String added in v0.1.9

func (c ConfidenceLevel) String() string

String returns the string representation of the confidence level.

func (ConfidenceLevel) ToProto

ToProto converts a ConfidenceLevel to its protobuf representation.

type ConfidenceThreshold

type ConfidenceThreshold float64

ConfidenceThreshold represents the threshold value for a confidence level.

func (ConfidenceThreshold) ToProto

ToProto converts a ConfidenceThreshold to its protobuf representation.

type Contract

type Contract struct {
	// Name of the contract.
	Name string `json:"name"`

	// Functions is a slice of Function structs, representing the functions defined in the contract standard.
	Functions []Function `json:"functions"`

	// Events is a slice of Event structs, representing the events defined in the contract standard.
	Events []Event `json:"events"`
}

Contract represents an Ethereum smart contract that attempts to confirm to a standard interface, such as the ERC-20 or ERC-721 standards. Used while performing a contract standard detection.

func (*Contract) ToProto

func (c *Contract) ToProto() *eip_pb.Contract

ToProto converts the Event to its protobuf representation.

type ContractStandard

type ContractStandard struct {
	// Name specifies the name of the contract standard, e.g., "ERC-20 Token Standard".
	Name string `json:"name"`

	// Url specifies the URL of the contract standard, e.g., "https://eips.ethereum.org/EIPS/eip-20".
	Url string `json:"url"`

	// Type specifies the type of the contract standard, e.g., ERC20 or ERC721.
	Type Standard `json:"type"`

	// Stagnant indicates whether the contract standard is stagnant in terms of development.
	Stagnant bool `json:"stagnant"`

	// Functions is a slice of Function structs, representing the functions defined in the contract standard.
	Functions []Function `json:"functions"`

	// Events is a slice of Event structs, representing the events defined in the contract standard.
	Events []Event `json:"events"`
}

ContractStandard represents a standard interface for Ethereum smart contracts, such as the ERC-20 or ERC-721 standards.

func (*ContractStandard) ToProto

func (cs *ContractStandard) ToProto() *eip_pb.ContractStandard

ToProto converts the ContractStandard to its protobuf representation.

type Discovery

type Discovery struct {
	// Confidence specifies the confidence level of the discovery.
	Confidence ConfidenceLevel `json:"confidence"`

	// ConfidencePoints specifies the confidence points of the discovery.
	ConfidencePoints float64 `json:"confidence_points"`

	// Threshold specifies the threshold level of the discovery.
	Threshold ConfidenceThreshold `json:"threshold"`

	// MaximumTokens specifies the maximum number of tokens in the standard.
	// This is basically a standard TokenCount() function response value.
	MaximumTokens int `json:"maximum_tokens"`

	// DiscoverdTokens specifies the number of tokens discovered in the standard.
	// The more tokens discovered, the higher the confidence level.
	DiscoveredTokens int `json:"discovered_tokens"`

	// ContractStandard that is being scanned.
	Standard Standard `json:"standard"`

	// Contract that is being scanned including mathed functions and events.
	Contract *Contract `json:"contract"`
}

Discovery represents a contract standard discovery response.

func ConfidenceCheck

func ConfidenceCheck(standard EIP, contract *Contract) (Discovery, bool)

ConfidenceCheck checks the confidence of a contract against a standard EIP.

func (*Discovery) ToProto

func (d *Discovery) ToProto() *eip_pb.Discovery

ToProto converts the Discovery to its protobuf representation.

type EIP

type EIP interface {
	// GetName returns the name of the Ethereum standard, e.g., "ERC-20 Token Standard".
	GetName() string

	// GetType returns the type of the Ethereum standard, e.g., ERC20 or ERC721.
	GetType() Standard

	// GetFunctions returns a slice of Function structs, representing the
	// functions defined in the Ethereum standard.
	GetFunctions() []Function

	// GetUrl returns the URL of the Ethereum standard.
	GetUrl() string

	// IsStagnant returns a boolean indicating whether the Ethereum standard is stagnant.
	IsStagnant() bool

	// GetEvents returns a slice of Event structs, representing the
	// events defined in the Ethereum standard.
	GetEvents() []Event

	// GetStandard returns the complete representation of the Ethereum standard.
	GetStandard() ContractStandard

	// ConfidenceCheck returns a discovery confidence information and a boolean indicating whether
	// the contract is to any level compliant with the Ethereum standard.
	ConfidenceCheck(contract *Contract) (Discovery, bool)

	// TokenCount returns the number of tokens associated with the Ethereum standard.
	TokenCount() int

	// ToProto converts the Ethereum standard to its protobuf representation.
	ToProto() *eip_pb.ContractStandard

	// String returns a string representation of the Ethereum standard, typically its name.
	String() string
}

EIP is an interface that defines the standard methods required for representing Ethereum Improvement Proposals and Ethereum standards.

func GetSortedRegisteredStandards

func GetSortedRegisteredStandards() []EIP

GetSortedRegisteredStandards retrieves all the registered Ethereum standards from the storage in a sorted order.

func GetStandard

func GetStandard(s Standard) (EIP, bool)

GetStandard retrieves the details of a registered Ethereum standard.

Parameters: - s: The Ethereum standard type.

Returns: - ContractStandard: The details of the Ethereum standard if it exists. - bool: A boolean indicating if the standard exists in the storage.

func NewEip20

func NewEip20() EIP

NewEip20 initializes and returns an instance of the ERC-20 standard. It sets up the standard with its name, type, associated functions, and events.

func NewEip721

func NewEip721() EIP

NewEip721 initializes and returns an instance of the EIP-721 standard. It sets up the standard with its name, type, associated functions, and events.

func NewEip1155

func NewEip1155() EIP

NewEip1155 initializes and returns an instance of the EIP-1155 standard.

func NewEip1820

func NewEip1820() EIP

NewEip1820 initializes and returns an instance of the EIP-1820 standard.

func NewEip1822

func NewEip1822() EIP

NewEip1822 initializes and returns an instance of the EIP-1822 standard.

func NewEip1967

func NewEip1967() EIP

NewEip1967 initializes and returns an instance of the EIP-1967 standard.

type Eip20

type Eip20 struct {
	// Standard holds the details of the ERC-20 contract standard.
	Standard ContractStandard
}

Eip20 represents the ERC-20 token standard.

func (Eip20) ConfidenceCheck

func (e Eip20) ConfidenceCheck(contract *Contract) (Discovery, bool)

func (Eip20) GetEvents

func (e Eip20) GetEvents() []Event

GetEvents returns the events associated with the ERC-20 standard.

func (Eip20) GetFunctions

func (e Eip20) GetFunctions() []Function

GetFunctions returns the functions associated with the ERC-20 standard.

func (Eip20) GetName

func (e Eip20) GetName() string

GetName returns the name of the ERC-20 standard.

func (Eip20) GetStandard

func (e Eip20) GetStandard() ContractStandard

GetStandard returns the complete ERC-20 contract standard.

func (Eip20) GetType

func (e Eip20) GetType() Standard

GetType returns the type of the ERC-20 standard.

func (Eip20) GetUrl

func (e Eip20) GetUrl() string

GetUrl returns the URL of the ERC-20 standard.

func (Eip20) IsStagnant

func (e Eip20) IsStagnant() bool

IsStagnant returns a boolean indicating whether the ERC-20 standard is stagnant.

func (Eip20) String

func (e Eip20) String() string

String returns the name of the ERC-20 standard.

func (Eip20) ToProto

func (e Eip20) ToProto() *eip_pb.ContractStandard

ToProto returns a protobuf representation of the ERC-20 standard.

func (Eip20) TokenCount

func (e Eip20) TokenCount() int

TokenCount returns the number of tokens associated with the ERC-20 standard.

type Eip721

type Eip721 struct {
	// Standard holds the details of the EIP-721 contract standard.
	Standard ContractStandard
}

Eip721 represents the EIP-721 token standard (NFT standard).

func (Eip721) ConfidenceCheck

func (e Eip721) ConfidenceCheck(contract *Contract) (Discovery, bool)

ConfidenceCheck checks the contract for the EIP-721 standard compliance.

func (Eip721) GetEvents

func (e Eip721) GetEvents() []Event

GetEvents returns the events associated with the EIP-721 standard.

func (Eip721) GetFunctions

func (e Eip721) GetFunctions() []Function

GetFunctions returns the functions associated with the EIP-721 standard.

func (Eip721) GetName

func (e Eip721) GetName() string

GetName returns the name of the EIP-721 standard.

func (Eip721) GetStandard

func (e Eip721) GetStandard() ContractStandard

GetStandard returns the complete EIP-721 contract standard.

func (Eip721) GetType

func (e Eip721) GetType() Standard

GetType returns the type of the EIP-721 standard.

func (Eip721) GetUrl

func (e Eip721) GetUrl() string

GetUrl returns the URL of the EIP-721 standard.

func (Eip721) IsStagnant

func (e Eip721) IsStagnant() bool

IsStagnant returns a boolean indicating whether the EIP-721 standard is stagnant.

func (Eip721) String

func (e Eip721) String() string

String returns the name of the EIP-721 standard.

func (Eip721) ToProto

func (e Eip721) ToProto() *eip_pb.ContractStandard

ToProto returns a protobuf representation of the EIP-721 standard.

func (Eip721) TokenCount

func (e Eip721) TokenCount() int

TokenCount returns the number of tokens associated with the EIP-721 standard.

type Eip1155

type Eip1155 struct {
	// Standard holds the details of the EIP-1155 contract standard.
	Standard ContractStandard
}

Eip1155 represents the EIP-1155 Multi Token Standard.

func (Eip1155) ConfidenceCheck

func (e Eip1155) ConfidenceCheck(contract *Contract) (Discovery, bool)

ConfidenceCheck checks the contract for the EIP-1155 standard compliance.

func (Eip1155) GetEvents

func (e Eip1155) GetEvents() []Event

GetEvents returns the events associated with the EIP-1155 standard.

func (Eip1155) GetFunctions

func (e Eip1155) GetFunctions() []Function

GetFunctions returns the functions associated with the EIP-1155 standard.

func (Eip1155) GetName

func (e Eip1155) GetName() string

GetName returns the name of the EIP-1155 standard.

func (Eip1155) GetStandard

func (e Eip1155) GetStandard() ContractStandard

GetStandard returns the complete EIP-1155 contract standard.

func (Eip1155) GetType

func (e Eip1155) GetType() Standard

GetType returns the type of the EIP-1155 standard.

func (Eip1155) GetUrl

func (e Eip1155) GetUrl() string

GetUrl returns the URL of the EIP-1155 standard.

func (Eip1155) IsStagnant

func (e Eip1155) IsStagnant() bool

IsStagnant returns a boolean indicating whether the EIP-1155 standard is stagnant.

func (Eip1155) String

func (e Eip1155) String() string

String returns the name of the EIP-1155 standard.

func (Eip1155) ToProto

func (e Eip1155) ToProto() *eip_pb.ContractStandard

ToProto returns a protobuf representation of the EIP-1155 standard.

func (Eip1155) TokenCount

func (e Eip1155) TokenCount() int

TokenCount returns the number of tokens associated with the EIP-1155 standard.

type Eip1820

type Eip1820 struct {
	// Standard holds the details of the EIP-1820 contract standard.
	Standard ContractStandard
}

Eip1820 represents the EIP-1820 Pseudo-introspection Registry Contract.

func (Eip1820) ConfidenceCheck

func (e Eip1820) ConfidenceCheck(contract *Contract) (Discovery, bool)

ConfidenceCheck checks the contract for the EIP-1820 standard compliance.

func (Eip1820) GetEvents

func (e Eip1820) GetEvents() []Event

GetEvents returns the events associated with the EIP-1820 standard.

func (Eip1820) GetFunctions

func (e Eip1820) GetFunctions() []Function

GetFunctions returns the functions associated with the EIP-1820 standard.

func (Eip1820) GetName

func (e Eip1820) GetName() string

GetName returns the name of the EIP-1820 standard.

func (Eip1820) GetStandard

func (e Eip1820) GetStandard() ContractStandard

GetStandard returns the complete EIP-1820 contract standard.

func (Eip1820) GetType

func (e Eip1820) GetType() Standard

GetType returns the type of the EIP-1820 standard.

func (Eip1820) GetUrl

func (e Eip1820) GetUrl() string

GetUrl returns the URL of the EIP-1820 standard.

func (Eip1820) IsStagnant

func (e Eip1820) IsStagnant() bool

IsStagnant returns a boolean indicating whether the EIP-1820 standard is stagnant.

func (Eip1820) String

func (e Eip1820) String() string

String returns the name of the EIP-1820 standard.

func (Eip1820) ToProto

func (e Eip1820) ToProto() *eip_pb.ContractStandard

ToProto returns a protobuf representation of the EIP-1820 standard.

func (Eip1820) TokenCount

func (e Eip1820) TokenCount() int

TokenCount returns the number of tokens associated with the EIP-1820 standard.

type Eip1822

type Eip1822 struct {
	// Standard holds the details of the EIP-1822 contract standard.
	Standard ContractStandard
}

Eip1822 represents the EIP-1822 Universal Proxy Standard (UPS).

func (Eip1822) ConfidenceCheck

func (e Eip1822) ConfidenceCheck(contract *Contract) (Discovery, bool)

ConfidenceCheck checks the contract for the EIP-1822 standard compliance.

func (Eip1822) GetEvents

func (e Eip1822) GetEvents() []Event

GetEvents returns the events associated with the EIP-1822 standard.

func (Eip1822) GetFunctions

func (e Eip1822) GetFunctions() []Function

GetFunctions returns the functions associated with the EIP-1822 standard.

func (Eip1822) GetName

func (e Eip1822) GetName() string

GetName returns the name of the EIP-1822 standard.

func (Eip1822) GetStandard

func (e Eip1822) GetStandard() ContractStandard

GetStandard returns the complete EIP-1822 contract standard.

func (Eip1822) GetType

func (e Eip1822) GetType() Standard

GetType returns the type of the EIP-1822 standard.

func (Eip1822) GetUrl

func (e Eip1822) GetUrl() string

GetUrl returns the URL of the EIP-1822 standard.

func (Eip1822) IsStagnant

func (e Eip1822) IsStagnant() bool

IsStagnant returns a boolean indicating whether the EIP-1822 standard is stagnant.

func (Eip1822) String

func (e Eip1822) String() string

String returns the name of the EIP-1822 standard.

func (Eip1822) ToProto

func (e Eip1822) ToProto() *eip_pb.ContractStandard

ToProto returns a protobuf representation of the EIP-1822 standard.

func (Eip1822) TokenCount

func (e Eip1822) TokenCount() int

TokenCount returns the number of tokens associated with the EIP-1822 standard.

type Eip1967

type Eip1967 struct {
	// Standard holds the details of the EIP-1967 contract standard.
	Standard ContractStandard
}

Eip1967 represents the EIP-1967 Proxy Storage Slots standard.

func (Eip1967) ConfidenceCheck

func (e Eip1967) ConfidenceCheck(contract *Contract) (Discovery, bool)

ConfidenceCheck checks the contract for the EIP-1967 standard compliance.

func (Eip1967) GetEvents

func (e Eip1967) GetEvents() []Event

GetEvents returns the events associated with the EIP-1967 standard.

func (Eip1967) GetFunctions

func (e Eip1967) GetFunctions() []Function

GetFunctions returns the functions associated with the EIP-1967 standard.

func (Eip1967) GetName

func (e Eip1967) GetName() string

GetName returns the name of the EIP-1967 standard.

func (Eip1967) GetStandard

func (e Eip1967) GetStandard() ContractStandard

GetStandard returns the complete EIP-1967 contract standard.

func (Eip1967) GetType

func (e Eip1967) GetType() Standard

GetType returns the type of the EIP-1967 standard.

func (Eip1967) GetUrl

func (e Eip1967) GetUrl() string

GetUrl returns the URL of the EIP-1967 standard.

func (Eip1967) IsStagnant

func (e Eip1967) IsStagnant() bool

IsStagnant returns a boolean indicating whether the EIP-1967 standard is stagnant.

func (Eip1967) String

func (e Eip1967) String() string

String returns the name of the EIP-1967 standard.

func (Eip1967) ToProto

func (e Eip1967) ToProto() *eip_pb.ContractStandard

ToProto returns a protobuf representation of the EIP-1967 standard.

func (Eip1967) TokenCount

func (e Eip1967) TokenCount() int

TokenCount returns the number of tokens associated with the EIP-1967 standard.

type Event

type Event struct {
	// Name specifies the name of the event.
	Name string `json:"name"`

	// Inputs is a slice of Input structs, representing the input parameters of the event.
	Inputs []Input `json:"inputs"`

	// Outputs is a slice of Output structs, representing the data types of the event's return values.
	Outputs []Output `json:"outputs"`

	// Matched indicates whether the input has been matched via confidence check.
	Matched bool `json:"matched"`
}

Event represents an Ethereum smart contract event.

func (*Event) ToProto

func (e *Event) ToProto() *eip_pb.Event

ToProto converts the Event to its protobuf representation.

type Function

type Function struct {
	// Name specifies the name of the function.
	Name string `json:"name"`

	// Inputs is a slice of Input structs, representing the input parameters of the function.
	Inputs []Input `json:"inputs"`

	// Outputs is a slice of Output structs, representing the data types of the function's return values.
	Outputs []Output `json:"outputs"`

	// Matched indicates whether the input has been matched via confidence check.
	Matched bool `json:"matched"`
}

Function represents an Ethereum smart contract function.

func (*Function) ToProto

func (f *Function) ToProto() *eip_pb.Function

ToProto converts the Function to its protobuf representation.

type Input

type Input struct {
	// Type specifies the Ethereum data type of the input.
	Type string `json:"type"`

	// Indexed indicates whether the input is indexed.
	// This is particularly relevant for event parameters,
	// where indexed parameters can be used as a filter for event logs.
	Indexed bool `json:"indexed"`

	// Matched indicates whether the input has been matched via confidence check.
	Matched bool `json:"matched"`
}

Input represents an input parameter for Ethereum functions and events.

func (*Input) ToProto

func (i *Input) ToProto() *eip_pb.Input

ToProto converts the Input to its protobuf representation.

type Output

type Output struct {
	// Type specifies the Ethereum data type of the output.
	Type string `json:"type"`

	// Matched indicates whether the output has been matched via confidence check.
	Matched bool `json:"matched"`
}

Output represents an output parameter for Ethereum functions and events.

func (*Output) ToProto

func (i *Output) ToProto() *eip_pb.Output

ToProto converts the Output to its protobuf representation.

type Standard

type Standard string

Standard represents the type for Ethereum standards and EIPs.

const (
	EIP20   Standard = "EIP20"   // ERC-20 Token Standard.
	EIP721  Standard = "EIP721"  // ERC-721 Non-Fungible Token Standard.
	EIP1822 Standard = "EIP1822" // EIP-1822 Universal Proxy Standard (UPS).
	EIP1820 Standard = "EIP1820" // EIP-1820 Pseudo-introspection Registry Contract.
	EIP777  Standard = "EIP777"  // ERC-777 Token Standard.
	EIP1155 Standard = "EIP1155" // ERC-1155 Multi Token Standard.
	EIP1337 Standard = "EIP1337" // ERC-1337 Subscription Standard.
	EIP1400 Standard = "EIP1400" // ERC-1400 Security Token Standard.
	EIP1410 Standard = "EIP1410" // ERC-1410 Partially Fungible Token Standard.
	EIP165  Standard = "EIP165"  // ERC-165 Standard Interface Detection.
	EIP820  Standard = "EIP820"  // ERC-820 Registry Standard.
	EIP1014 Standard = "EIP1014" // ERC-1014 Create2 Standard.
	EIP1948 Standard = "EIP1948" // ERC-1948 Non-Fungible Data Token Standard.
	EIP1967 Standard = "EIP1967" // EIP-1967 Proxy Storage Slots Standard.
	EIP2309 Standard = "EIP2309" // ERC-2309 Consecutive Transfer Standard.
	EIP2535 Standard = "EIP2535" // ERC-2535 Diamond Standard.
	EIP2771 Standard = "EIP2771" // ERC-2771 Meta Transactions Standard.
	EIP2917 Standard = "EIP2917" // ERC-2917 Interest-Bearing Tokens Standard.
	EIP3156 Standard = "EIP3156" // ERC-3156 Flash Loans Standard.
	EIP3664 Standard = "EIP3664" // ERC-3664 BitWords Standard.
)

Constants representing various Ethereum standards and EIPs.

func (Standard) String

func (s Standard) String() string

String returns the string representation of the Standard.

func (Standard) ToProto

func (s Standard) ToProto() eip_pb.Standard

ToProto() converts a string representation of an Ethereum standard to its corresponding protobuf enum value. If the standard is not recognized, it returns unknown.

Jump to

Keyboard shortcuts

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