Documentation ¶
Index ¶
- Constants
- Variables
- type ArgKind
- type ArgType
- type Effect
- type FuncParam
- type FuncSig
- func (fsig *FuncSig) ABI() (*abi.ABI, error)
- func (fsig *FuncSig) Describe() string
- func (fsig *FuncSig) Effects() Effect
- func (fsig *FuncSig) Inputs() []FuncParam
- func (fsig *FuncSig) Name() string
- func (fsig *FuncSig) Outputs() []FuncParam
- func (fsig *FuncSig) String() string
- func (fsig *FuncSig) UnpackInput(data []byte) ([]interface{}, error)
- func (fsig *FuncSig) UnpackOutput(data []byte) ([]interface{}, error)
- func (fsig *FuncSig) WellKnown() bool
- type FuncSignature
- type WellKnownFuncDesc
- func (desc *WellKnownFuncDesc) Description() string
- func (desc *WellKnownFuncDesc) Effects() Effect
- func (desc *WellKnownFuncDesc) Inputs() []FuncParam
- func (desc *WellKnownFuncDesc) MethodID() []byte
- func (desc *WellKnownFuncDesc) MethodIDHex() string
- func (desc *WellKnownFuncDesc) Name() string
- func (desc *WellKnownFuncDesc) Outputs() []FuncParam
Constants ¶
View Source
const ( // EffectStateWrite is the effect of a function call that writes to a storage EffectStateWrite = EffectWrite | effectClassMax<<iota<<1 // EffectAddressWrite is the effect of a function call that writes to an address EffectAddressWrite = EffectWrite | effectClassMax<<iota<<1 // EffectTransfer is the effect of a function call that transfers funds EffectTransfer Effect = EffectStateWrite | EffectTrigger | effectClassMax<<iota<<1 // EffectMint is the effect of a function call that mints tokens EffectMint = EffectTransfer | effectClassMax<<iota<<1 // EffectBurn is the effect of a function call that burns tokens EffectBurn = EffectTransfer | effectClassMax<<iota<<1 // EffectSelfdestruct is the effect of a function call that selfdestructs the contract EffectSelfdestruct = EffectAddressWrite | EffectStateWrite | EffectTrigger | effectClassMax<<iota<<1 // EffectRBACUpdate is the effect of a function call that updates the RBAC EffectRBACUpdate = EffectStateWrite | effectClassMax<<iota<<1 )
Variables ¶
View Source
var ( ArgTypeUnknown = ArgType{Kind: ArgKindUnknown} ArgTypeAddress = ArgType{Kind: ArgKindAddress, OffsetLen: 20} ArgTypeBool = ArgType{Kind: ArgKindBool, OffsetLen: 32} ArgTypeString = ArgType{Kind: ArgKindString} ArgTypeUint = ArgType{Kind: ArgKindUint, OffsetLen: 32} )
Functions ¶
This section is empty.
Types ¶
type Effect ¶
type Effect uint64
const ( // EffectUnknown is the effect of a function call that does not change the state EffectUnknown Effect = 0 // EffectRead is the effect of a function call that reads the state EffectRead Effect = 1 << iota // EffectWrite is the effect of a function call that changes any data on the blockchain EffectWrite // EffectTrigger is the effect of a function call that triggers an event EffectTrigger )
type FuncSig ¶
type FuncSig struct {
// contains filtered or unexported fields
}
func (*FuncSig) UnpackInput ¶
func (*FuncSig) UnpackOutput ¶
type FuncSignature ¶
type FuncSignature interface { // Name is the name of the function Name() string // Inputs is the list of input parameters Inputs() []FuncParam // Outputs is the list of output parameters Outputs() []FuncParam // String returns the string representation of the function signature String() string // WellKnown returns true if the function signature is well known or commonly used // in the Ethereum ecosystem (e.g. balanceOf, transfer, etc.) WellKnown() bool // Effects returns the list of side effects of the function call, // if given function signature is known to have specific side effects. Effects() Effect // Describe returns a string describing the function signature, including a functional description // if available Describe() string // UnpackInput upacks values from given function data and returns a list of Go values. // The function signature must match the function data. UnpackInput(data []byte) ([]interface{}, error) // UnpackOutput upacks values from given function data and returns a list of Go values. // The function signature must match the function data. UnpackOutput(data []byte) ([]interface{}, error) }
func NewFuncSignatureFromString ¶
func NewFuncSignatureFromString(sig string) (FuncSignature, error)
type WellKnownFuncDesc ¶
type WellKnownFuncDesc struct {
// contains filtered or unexported fields
}
func GetWellKnownFuncByMethodID ¶
func GetWellKnownFuncByMethodID(methodID []byte) (*WellKnownFuncDesc, bool)
func GetWellKnownFuncBySig ¶
func GetWellKnownFuncBySig(sig string) (*WellKnownFuncDesc, bool)
func GetWellKnownFuncsByName ¶
func GetWellKnownFuncsByName(name string) []*WellKnownFuncDesc
func (*WellKnownFuncDesc) Description ¶
func (desc *WellKnownFuncDesc) Description() string
func (*WellKnownFuncDesc) Effects ¶
func (desc *WellKnownFuncDesc) Effects() Effect
func (*WellKnownFuncDesc) Inputs ¶
func (desc *WellKnownFuncDesc) Inputs() []FuncParam
func (*WellKnownFuncDesc) MethodID ¶
func (desc *WellKnownFuncDesc) MethodID() []byte
func (*WellKnownFuncDesc) MethodIDHex ¶
func (desc *WellKnownFuncDesc) MethodIDHex() string
func (*WellKnownFuncDesc) Name ¶
func (desc *WellKnownFuncDesc) Name() string
func (*WellKnownFuncDesc) Outputs ¶
func (desc *WellKnownFuncDesc) Outputs() []FuncParam
Click to show internal directories.
Click to hide internal directories.