Documentation ¶
Index ¶
- Variables
- func InitERC(bc BlockChain)
- func InitRPCUrl(bc BlockChain)
- func InitUnit(bc BlockChain)
- func NewBatchKeyedTransactorByAccount(wallet *keystore.KeyStore, account accounts.Account, networkID *big.Int) *bind.TransactOpts
- func NewKeyedTransactor(key *ecdsa.PrivateKey, networkID *big.Int) *bind.TransactOpts
- func NewKeyedTransactorByAccount(wallet *keystore.KeyStore, account accounts.Account, passphrase string, ...) *bind.TransactOpts
- func NewTransactor(keyin io.Reader, passphrase string, networkID *big.Int) (*bind.TransactOpts, error)
- func TestCLIVersion(t *testing.T)
- type BlockChain
- type CLI
- func (cli *CLI) BuildClient() error
- func (cli *CLI) Deploy(address, name, symbol, baseTokenURI string, decimals uint8, ...)
- func (cli *CLI) Embeddable() *CLI
- func (cli *CLI) Execute()
- func (cli *CLI) GetSimpleToken() (SimpleToken, error)
- func (cli *CLI) Run(args ...string) string
- func (cli *CLI) SetPassword(_passPhrase string) *CLI
- func (cli *CLI) TestCommand(command string) string
- type SimpleToken
Constants ¶
This section is empty.
Variables ¶
var ( UnitETH = "ETH" UnitWEI = "WEI" // UnitList is array for Unit string // UnitList = []string{"Wei", "Ada", "Babbage", "Shannon", "Szabo", "Finney", "Ether", "Einstein", "Douglas", "Gwei"} UnitList []string // UnitString is for Unit string // UnitString = "Available unit: Wei, Ada, Babbage, Shannon, Szabo, Finney, Ether, Einstein, Douglas, Gwei" UnitString string )
Unit
var ( // ModeERC20 https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md ModeERC20 = "ERC20" // ModeERC721 https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md ModeERC721 = "ERC721" // UnitList is array for Unit string // UnitList = []string{"Wei", "Ada", "Babbage", "Shannon", "Szabo", "Finney", "Ether", "Einstein", "Douglas", "Gwei"} ModeERCList []string )
var GasFail = "failed to estimate gas needed: gas required exceeds allowance or always failing transaction"
GasFail GasFail info from SuggestGasPrice
var IsDecimalString = regexp.MustCompile(`^[1-9]\d*$|^0$|^0\.\d*$|^[1-9](\d)*\.(\d)*$`).MatchString
IsDecimalString Check whether amount string is legal amount
var MinterRole = crypto.Keccak256([]byte("MINTER_ROLE")) // 0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6}
var TxFailAlways = "This is a transaction that will always fail. Please check contract and parameters again."
TxFailAlways Replacement information GasFail
Functions ¶
func InitERC ¶
func InitERC(bc BlockChain)
func InitRPCUrl ¶
func InitRPCUrl(bc BlockChain)
func InitUnit ¶
func InitUnit(bc BlockChain)
func NewKeyedTransactor ¶
func NewKeyedTransactor(key *ecdsa.PrivateKey, networkID *big.Int) *bind.TransactOpts
NewKeyedTransactor is a utility method to easily create a transaction signer from a single private key.
func NewTransactor ¶
func NewTransactor(keyin io.Reader, passphrase string, networkID *big.Int) (*bind.TransactOpts, error)
NewTransactor is a utility method to easily create a transaction signer from an encrypted json key stream and the associated passphrase.
Types ¶
type BlockChain ¶
type BlockChain int
BlockChain type
const ( UnknownChain BlockChain = iota NewChain Ethereum )
func (BlockChain) Init ¶
func (bc BlockChain) Init()
func (BlockChain) String ¶
func (bc BlockChain) String() string
type CLI ¶
type CLI struct { Name string SimpleToken SimpleToken // contains filtered or unexported fields }
CLI represents a command-line interface. This class is not threadsafe.
func (*CLI) Deploy ¶
func (cli *CLI) Deploy(address, name, symbol, baseTokenURI string, decimals uint8, totalSupply *big.Int)
Deploy deploy contract
func (*CLI) Embeddable ¶
Embeddable returns a CLI that you can embed into your own Go programs. This is not thread-safe.
func (*CLI) GetSimpleToken ¶
func (cli *CLI) GetSimpleToken() (SimpleToken, error)
GetSimpleToken GetSimpleToken
func (*CLI) SetPassword ¶
SetPassword SetPassword
func (*CLI) TestCommand ¶
TestCommand test command
type SimpleToken ¶
type SimpleToken interface { // Name returns the name of the token Name(opts *bind.CallOpts) (string, error) // Symbol returns the symbol of the token Symbol(opts *bind.CallOpts) (string, error) // TotalSupply returns the total token supply TotalSupply(opts *bind.CallOpts) (*big.Int, error) // BalanceOf returns the account balance of another account with address owner BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) }
SimpleToken simpleToken interface