Documentation ¶
Index ¶
- Constants
- func AddZerosToEnd(num *big.Int, i int) *big.Int
- func EtherToWei(eth *big.Float) *big.Int
- func GeneratePairAddress(token0, token1, FactoryAddress common.Address, pairAddressSuffix string) common.Address
- func GetBalancesMapSlot(holder common.Address, position int) [32]byte
- func ParseUnits(num *big.Int, decimals uint8) *big.Float
- func RemoveZerosFromEnd(num *big.Int, i int) *big.Int
- func SolidityEncode(types []string, values []interface{}) (data []byte, err error)
- func SortTokens(tokenA, tokenB common.Address) (common.Address, common.Address)
- func WeiToEther(wei *big.Int) *big.Float
Constants ¶
View Source
const ( Wei = 1 GWei = 1e9 Ether = 1e18 )
Variables ¶
This section is empty.
Functions ¶
func AddZerosToEnd ¶
Adds i amount of decimals from num (returning num as *big.Int)
func GeneratePairAddress ¶
func GeneratePairAddress(token0, token1, FactoryAddress common.Address, pairAddressSuffix string) common.Address
GeneratePairAddress generates a pair address for the given tokens (for UniswapV2 or clones, requires pairAddressSuffic and factory address of clone instance)
func GetBalancesMapSlot ¶
returns the storage key slot for a holder.
Position is the index slot (storage index of amount balances map). You can use github.com/vocdoni/storage-proofs-eth-go/token useful library to get the memory slot of the map its self
func ParseUnits ¶
go implimentation of ethers parse units (returns big.Int as big.Float to whichever decimal precision you like)
func RemoveZerosFromEnd ¶
Removes i amount of decimals from num (returning num as *big.Int)
func SolidityEncode ¶
implimentation of solidity abi.Encode
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.