internalized

package
v1.10.0-beta.20201225 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ETHER = "ETHER"
	ERC20 = "ERC20"
)

Variables

This section is empty.

Functions

func DeploySimpleMultiSigContract

func DeploySimpleMultiSigContract(nonceBucketNum uint16, chainID *big.Int, backend bind.ContractBackend, privkHex string, hexAddress []string, mRequired uint8) (string, error)

DeploySimpleMultiSigContract 创建部署一个多签合约,返回合约地址 address: 签名的参与者, mRequired: m-n 至少多少人签名生效 return: address_hex,txid

func ExecuteTX

func ExecuteTX(txp *TxParams) (string, error)

ExecuteTX .

func GetContractInfo

func GetContractInfo(caller bind.ContractCaller, contractAddress string) (addrs []string, mRequired int64, err error)

GetContractInfo 获取多签合约地址内的地址和签名人数

func New

func New(bip44Path string, seed []byte) (c *eth, err error)

func NewFromMetadata

func NewFromMetadata(md core.MetadataProvider) (c *eth, err error)

func NewOperatingMessage

func NewOperatingMessage(prefix string, toAddress common.Address, value *big.Int, data []byte, expireTime *big.Int, sequenceId *big.Int) *operatingMessage

func NewOperatingMessageFromHex

func NewOperatingMessageFromHex(hex string) (opMsg *operatingMessage, err error)

func NewTransactionFromHex

func NewTransactionFromHex(hex string) (transaction *types.Transaction, err error)

func SimpleMultiSigExecuteSign

func SimpleMultiSigExecuteSign(expireTime *big.Int, chainID int64, signerPrivkHex string, multisigContractAddr, destinationAddr, executor string, nonce *big.Int, value, gasLimit *big.Int, data []byte) (uint8, [32]byte, [32]byte, error)

SimpleMultiSigExecuteSign return v,r,s

Types

type MultiSignTx

type MultiSignTx struct {
	ExpireTime   *big.Int //time.Time.Unix()值,在该时间之后区块打包会失败, (不用int64, int64会导致RLP encode失败)
	ChainID      uint64
	Symbol       string
	MultisigAddr string
	ToAddr       string
	Creator      string
	Executor     string
	Nonce        *big.Int
	Value        *big.Int
	GasLimit     *big.Int
	GasPrice     *big.Int
	Data         []byte
}

func NewMultiSignTxFromHex

func NewMultiSignTxFromHex(hex string) (*MultiSignTx, error)

func (*MultiSignTx) Sign

func (tx *MultiSignTx) Sign(privateKey *ecdsa.PrivateKey) (string, error)

type TxParams

type TxParams struct {
	Backend                              bind.ContractBackend
	BucketIdx                            uint16
	ExpireTime                           *big.Int
	SigV                                 []uint8    //签名
	SigR, SigS                           [][32]byte //签名
	PrivkHex                             string
	MultisigContractAddress, FromAddress string //多签合约地址,发起地址
	Destination, Executor                string //toAddress
	Value, GasLimit                      *big.Int
	Data                                 []byte
}

TxParams 交易参数

Directories

Path Synopsis
Package testtool 测试用辅助函数
Package testtool 测试用辅助函数

Jump to

Keyboard shortcuts

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