common

package
v0.0.0-...-a9af343 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BigPow

func BigPow(x, y int64) *big.Int

func DecodeTransactionInputDataToMap

func DecodeTransactionInputDataToMap(contractABI *abi.ABI, data []byte, inputsMap map[string]interface{}) (*abi.Method, error)

func DivideBigInt

func DivideBigInt(dividend *big.Int, divisor *big.Int) float64

DivideBigInt performs division of two big.Int numbers and returns the result as a float64. If an error occurs during the conversion, it returns 0 and the error.

func Exp

func Exp(base, exponent *big.Int) *big.Int

func GetSender

func GetSender(transaction *types.Transaction, chainId *big.Int) (common.Address, error)

Types

type Fraction

type Fraction struct {
	// contains filtered or unexported fields
}

func NewFraction

func NewFraction(numerator, denominator *big.Int) *Fraction

func NewFractionFromInt64

func NewFractionFromInt64(numerator, denominator int64) *Fraction

func (*Fraction) Add

func (f *Fraction) Add(other *Fraction) *Fraction

func (*Fraction) Divide

func (f *Fraction) Divide(other *Fraction) *Fraction

func (*Fraction) EqualTo

func (f *Fraction) EqualTo(other *Fraction) bool

func (*Fraction) GreaterThan

func (f *Fraction) GreaterThan(other *Fraction) bool

func (*Fraction) Invert

func (f *Fraction) Invert() *Fraction

func (*Fraction) LessThan

func (f *Fraction) LessThan(other *Fraction) bool

func (*Fraction) Multiply

func (f *Fraction) Multiply(other *Fraction) *Fraction

func (*Fraction) Quotient

func (f *Fraction) Quotient() *big.Int

func (*Fraction) Remainder

func (f *Fraction) Remainder() *Fraction

Remainder returns the remainder after floor division

func (*Fraction) Subtract

func (f *Fraction) Subtract(other *Fraction) *Fraction

func (*Fraction) ToFloat

func (f *Fraction) ToFloat() *big.Float

func (*Fraction) ToFloat64

func (f *Fraction) ToFloat64() (fl float64, exact bool)

Jump to

Keyboard shortcuts

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