contracts

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2018 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TxSignMu sync.RWMutex

Functions

func BuildTxOpeningRandomize added in v0.3.0

func BuildTxOpeningRandomize(nonce uint64, randomizeAddr common.Address, randomizeKey []byte) (*types.Transaction, error)

Send opening to randomize SMC.

func BuildTxSecretRandomize added in v0.3.0

func BuildTxSecretRandomize(nonce uint64, randomizeAddr common.Address, epocNumber uint64, randomizeKey []byte) (*types.Transaction, error)

Send secret key into randomize smartcontract.

func BuildValidatorFromM2 added in v0.3.0

func BuildValidatorFromM2(listM2 []int64) []byte

Get validators from m2 array integer.

func CalculateRewardForHolders

func CalculateRewardForHolders(foudationWalletAddr common.Address, validator *contractValidator.TomoValidator, state *state.StateDB, signer common.Address, calcReward *big.Int) error

Calculate reward for holders.

func CalculateRewardForSigner

func CalculateRewardForSigner(chainReward *big.Int, signers map[common.Address]*rewardLog, totalSigner uint64) (map[common.Address]*big.Int, error)

Calculate reward for signers.

func CreateTransactionSign

func CreateTransactionSign(chainConfig *params.ChainConfig, pool *core.TxPool, manager *accounts.Manager, block *types.Block, chainDb ethdb.Database) error

Send tx sign for block number to smart contract blockSigner.

func CreateTxSign

func CreateTxSign(blockNumber *big.Int, blockHash common.Hash, nonce uint64, blockSigner common.Address) *types.Transaction

Create tx sign.

func DecodeValidatorsHexData added in v0.3.0

func DecodeValidatorsHexData(validatorsStr string) ([]int64, error)

Decode validator hex string.

func Decrypt added in v0.3.0

func Decrypt(key []byte, cryptoText string) string

decrypt from base64 to decrypted string

func DecryptRandomizeFromSecretsAndOpening added in v0.3.0

func DecryptRandomizeFromSecretsAndOpening(secrets [][32]byte, opening [32]byte) (int64, error)

Decrypt randomize from secrets and opening.

func Encrypt added in v0.3.0

func Encrypt(key []byte, text string) string

encrypt string to base64 crypto using AES

func GenM2FromRandomize added in v0.3.0

func GenM2FromRandomize(randomizes []int64, lenSigners int64) ([]int64, error)

Generate m2 listing from randomize array.

func GetCandidatesOwnerBySigner

func GetCandidatesOwnerBySigner(validator *contractValidator.TomoValidator, signerAddr common.Address) common.Address

Get candidate owner by address.

func GetRandomizeFromContract added in v0.3.0

func GetRandomizeFromContract(client bind.ContractBackend, addrMasternode common.Address) (int64, error)

Get random from randomize contract.

func GetRewardBalancesRate

func GetRewardBalancesRate(foudationWalletAddr common.Address, masterAddr common.Address, totalReward *big.Int, validator *contractValidator.TomoValidator) (map[common.Address]*big.Int, error)

Get reward balance rates for master node, founder and holders.

func GetRewardForCheckpoint

func GetRewardForCheckpoint(chain consensus.ChainReader, blockSignerAddr common.Address, number uint64, rCheckpoint uint64, client bind.ContractBackend, totalSigner *uint64) (map[common.Address]*rewardLog, error)

Calculate reward for reward checkpoint.

func GetSignersFromContract

func GetSignersFromContract(addrBlockSigner common.Address, client bind.ContractBackend, blockHash common.Hash) ([]common.Address, error)

Get signers signed for blockNumber from blockSigner contract.

func NewSlice added in v0.3.0

func NewSlice(start int64, end int64, step int64) []int64

Dynamic generate array sequence of numbers.

func RandStringByte added in v0.3.0

func RandStringByte(n int) []byte

Generate random string.

func Shuffle added in v0.3.0

func Shuffle(slice []int64) []int64

Shuffle array.

Types

This section is empty.

Directories

Path Synopsis
Package chequebook package wraps the 'chequebook' Ethereum smart contract.
Package chequebook package wraps the 'chequebook' Ethereum smart contract.
ens

Jump to

Keyboard shortcuts

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