utils

package
v0.0.0-...-c2006ba Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// MaxSupply of LEV
	MaxSupply = ToWei(10000000.0, 18)
	// TeamTokens are the amount of tokens allocated to team
	TeamTokens = ToWei(7500.0, 18)
	// TeamTokensVested are the amount of tokens team is vesting
	TeamTokensVested = ToWei(5625.0, 18)
	// VestingPeriodMonths denotes the total vesting time
	VestingPeriodMonths = 12
	// VestingCycleMonths denotes the cyle at which individual tranches are released
	VestingCycleMonths = 1
)
View Source
var (
	// OneEthInWei is one ETH denominated in Wei
	OneEthInWei = big.NewInt(1000000000000000000)
)

Functions

func CalcGasCost

func CalcGasCost(gasLimit uint64, gasPrice *big.Int) *big.Int

CalcGasCost calculate gas cost given gas limit (units) and gas price (wei)

func IsValidAddress

func IsValidAddress(iaddress interface{}) bool

IsValidAddress validate hex address

func IsZeroAddress

func IsZeroAddress(iaddress interface{}) bool

IsZeroAddress validate if it's a 0 address

func NewAccount

func NewAccount() (*bind.TransactOpts, *ecdsa.PrivateKey, error)

NewAccount creates a new ethereum private key, and associated transactor

func PublicKeyBytesToAddress

func PublicKeyBytesToAddress(publicKey []byte) common.Address

PublicKeyBytesToAddress ...

func SigRSV

func SigRSV(isig interface{}) ([32]byte, [32]byte, uint8)

SigRSV signatures R S V returned as arrays

func ToDecimal

func ToDecimal(ivalue interface{}, decimals int) decimal.Decimal

ToDecimal wei to decimals

func ToWei

func ToWei(iamount interface{}, decimals int) *big.Int

ToWei decimals to wei

Types

This section is empty.

Jump to

Keyboard shortcuts

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