Documentation ¶
Index ¶
- Constants
- Variables
- func PaddedBigBytes(bigint *big.Int, n int) []byte
- func U256(n *big.Int) []byte
- type ABIContract
- func (abi *ABIContract) MethodById(sigdata []byte) (*Method, error)
- func (abi ABIContract) PackMethod(name string, args ...interface{}) ([]byte, error)
- func (abi ABIContract) PackMethodPanic(name string, args ...interface{}) []byte
- func (abi ABIContract) PackVariable(name string, args ...interface{}) ([]byte, error)
- func (abi ABIContract) PackVariablePanic(name string, args ...interface{}) []byte
- func (abi *ABIContract) UnmarshalJSON(data []byte) error
- func (abi ABIContract) UnpackEmptyMethod(name string, input []byte) (err error)
- func (abi ABIContract) UnpackMethod(v interface{}, name string, input []byte) (err error)
- func (abi ABIContract) UnpackVariable(v interface{}, name string, input []byte) (err error)
- func (abi ABIContract) UnpackVariablePanic(v interface{}, name string, input []byte)
- type Argument
- type Arguments
- type IntPool
- type Method
- type Type
- type Variable
Constants ¶
const ( // number of bits in chain big.Word WordBits = 32 << (uint64(^big.Word(0)) >> 63) // number of bytes in chain big.Word WordBytes = WordBits / 8 // number of bytes in chain vm word WordSize = 32 )
const ( IntTy byte = iota UintTy BoolTy StringTy SliceTy ArrayTy AddressTy TokenStandardTy FixedBytesTy BytesTy HashTy )
Type enumerator
Variables ¶
var PoolOfIntPools = &intPoolPool{ pools: make([]*IntPool, 0, poolDefaultCap), }
Functions ¶
Types ¶
type ABIContract ¶
func JSONToABIContract ¶
func JSONToABIContract(reader io.Reader) ABIContract
func (*ABIContract) MethodById ¶
func (abi *ABIContract) MethodById(sigdata []byte) (*Method, error)
MethodById looks up a method by the 4-byte id returns nil if none found
func (ABIContract) PackMethod ¶
func (abi ABIContract) PackMethod(name string, args ...interface{}) ([]byte, error)
func (ABIContract) PackMethodPanic ¶
func (abi ABIContract) PackMethodPanic(name string, args ...interface{}) []byte
func (ABIContract) PackVariable ¶
func (abi ABIContract) PackVariable(name string, args ...interface{}) ([]byte, error)
func (ABIContract) PackVariablePanic ¶
func (abi ABIContract) PackVariablePanic(name string, args ...interface{}) []byte
func (*ABIContract) UnmarshalJSON ¶
func (abi *ABIContract) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler interface
func (ABIContract) UnpackEmptyMethod ¶
func (abi ABIContract) UnpackEmptyMethod(name string, input []byte) (err error)
func (ABIContract) UnpackMethod ¶
func (abi ABIContract) UnpackMethod(v interface{}, name string, input []byte) (err error)
func (ABIContract) UnpackVariable ¶
func (abi ABIContract) UnpackVariable(v interface{}, name string, input []byte) (err error)
func (ABIContract) UnpackVariablePanic ¶
func (abi ABIContract) UnpackVariablePanic(v interface{}, name string, input []byte)
type Argument ¶
Argument holds the name of the argument and the corresponding type. Types are used when packing and testing arguments.
func (*Argument) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler interface
type Arguments ¶
type Arguments []Argument
func (Arguments) UnpackValues ¶
UnpackValues can be used to unpack ABI-encoded hexdata according to the ABI-specification, without supplying a struct to unpack into. Instead, this method returns a list containing the values. An atomic argument will be a list with one element.
type IntPool ¶
type IntPool struct {
// contains filtered or unexported fields
}
intPool is a pool of big integers that can be reused for all big.Int operations.
func (*IntPool) Get ¶
get retrieves a big int from the pool, allocating one if the pool is empty. Note, the returned int's amount is arbitrary and will not be zeroed!