Documentation ¶
Index ¶
Constants ¶
View Source
const ( BOOL = "bool" INT = "int" UINT = "uint" ADDRESS = "address" BYTES = "bytes" STRING = "string" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type InputData ¶
type InputData struct { Param SolidityDataType `json:"-"` //参数的数据类型 ParamName string `json:"paramName"` //参数名 Offset int64 `json:"-"` //偏移量,非值类型时为0 Data string `json:"data"` //数据内容 }
用于封装Transaction中Data字节数组的结构体
type InputDatas ¶
type InputDatas []InputData
type SolidityDataType ¶
type SolidityDataType struct { Name string `json:"name"` // 类型名,如:int32 Type Kind `json:"type"` // 值类型或引用类型 IsNumber bool `json:"isNumber"` // 是否数字 IsArray bool `json:"isArray"` // 是否数组 BitSize int `json:"bitSize"` // 以bit为单位的长度,用于以后补0,仅对值类型生效 }
用于描述Solidity数据类型的结构体
func GetSolidityTypeByName ¶
func GetSolidityTypeByName(name string) *SolidityDataType
通过参数类型获得相关信息 name = "uint" => returns { uint, value, 256 } // uint类型,值类型,256位 name = "string" => returns { string, variable, 0 } // string类型,非值类型,无意义 name = "byte3[10]" => returns { bytes3[10], value, 0} // bytes3数组类型,值类型,3*8*10=240位
func (SolidityDataType) String ¶
func (t SolidityDataType) String() string
type SolidityDataTypes ¶
type SolidityDataTypes []*SolidityDataType
type SolidityMethod ¶
type SolidityMethod struct { Name string `json:"name"` // 方法标识,如:function foo(uint id, string name) InputDatas InputDatas `json:"params"` }
用于描述Solidity函数的结构体
func TransformTxData ¶
func TransformTxData(abiStr string, input []byte) (*SolidityMethod, error)
转换transaction中的input
Click to show internal directories.
Click to hide internal directories.