github.com/neatio-net/neatio@v1.7.3-0.20231114194659-f4d7a2226baa/chain/accounts/abi/numbers.go (about)

     1  package abi
     2  
     3  import (
     4  	"math/big"
     5  	"reflect"
     6  
     7  	"github.com/neatio-net/neatio/utilities/common"
     8  	"github.com/neatio-net/neatio/utilities/common/math"
     9  )
    10  
    11  var (
    12  	bigT      = reflect.TypeOf(&big.Int{})
    13  	derefbigT = reflect.TypeOf(big.Int{})
    14  	uint8T    = reflect.TypeOf(uint8(0))
    15  	uint16T   = reflect.TypeOf(uint16(0))
    16  	uint32T   = reflect.TypeOf(uint32(0))
    17  	uint64T   = reflect.TypeOf(uint64(0))
    18  	int8T     = reflect.TypeOf(int8(0))
    19  	int16T    = reflect.TypeOf(int16(0))
    20  	int32T    = reflect.TypeOf(int32(0))
    21  	int64T    = reflect.TypeOf(int64(0))
    22  	addressT  = reflect.TypeOf(common.Address{})
    23  )
    24  
    25  func U256(n *big.Int) []byte {
    26  	return math.PaddedBigBytes(math.U256(n), 32)
    27  }