Documentation ¶
Index ¶
- Constants
- func KeyOfAddress2TokenBalance(tokenName, address string) string
- func KeyOfAddressVotingProposal(tokenName, address string) string
- func KeyOfAdmins() string
- func KeyOfAllowances(tokenName, address string) string
- func KeyOfFee(method string) string
- func KeyOfID2AddressAgreeVote(tokenName, topic, address string, id *big.Int) string
- func KeyOfID2AddressAgreeVotePrefix(tokenName, topic string, id *big.Int) string
- func KeyOfID2AddressOpposeVote(tokenName, topic, address string, id *big.Int) string
- func KeyOfID2AddressOpposeVotePrefix(tokenName, topic string, id *big.Int) string
- func KeyOfID2AddressWaiveVote(tokenName, topic, address string, id *big.Int) string
- func KeyOfID2AddressWaiveVotePrefix(tokenName, topic string, id *big.Int) string
- func KeyOfLatestProposalID(tokenName, topic string) string
- func KeyOfProposalID(tokenName, topic string, id *big.Int) string
- func KeyOfProposalResult(tokenName, topic string, id *big.Int) string
- func KeyOfProposer2Proposal(tokenName, address string) string
- func KeyOfToken(tokenName string) string
- func KeyOfToken2AddressBalance(tokenName, address string) string
- func KeyOfTokenOwner(tokenName string) string
- func KeyOfTokenProposal(tokenName string) string
- func KeyOfTopicData(tokenName, topic string) string
- type Balance
- type CheckVoteResult
- type Context
- type Contract
- func (c *Contract) AddAdmins(ctx contract.KContext) (*contract.Response, error)
- func (c *Contract) AddSupply(ctx contract.KContext) (*contract.Response, error)
- func (c *Contract) Allowance(ctx contract.KContext) (*contract.Response, error)
- func (c *Contract) Approve(ctx contract.KContext) (*contract.Response, error)
- func (c *Contract) BalanceOf(ctx contract.KContext) (*contract.Response, error)
- func (c *Contract) Burn(ctx contract.KContext) (*contract.Response, error)
- func (c *Contract) CheckVote(ctx contract.KContext) (*contract.Response, error)
- func (c *Contract) DelAdmins(ctx contract.KContext) (*contract.Response, error)
- func (c *Contract) GetFee(ctx contract.KContext) (*contract.Response, error)
- func (c *Contract) HasVoted(ctx contract.KContext, token, topic string, pID *big.Int) (bool, error)
- func (c *Contract) NewToken(ctx contract.KContext) (*contract.Response, error)
- func (c *Contract) Propose(ctx contract.KContext) (*contract.Response, error)
- func (c *Contract) QueryAdmins(ctx contract.KContext) (*contract.Response, error)
- func (c *Contract) QueryProposal(ctx contract.KContext) (*contract.Response, error)
- func (c *Contract) QueryProposalVotes(ctx contract.KContext) (*contract.Response, error)
- func (c *Contract) QueryToken(ctx contract.KContext) (*contract.Response, error)
- func (c *Contract) QueryTokenOwner(ctx contract.KContext) (*contract.Response, error)
- func (c *Contract) SetFee(ctx contract.KContext) (*contract.Response, error)
- func (c *Contract) StopVote(ctx contract.KContext) (*contract.Response, error)
- func (c *Contract) TotalSupply(ctx contract.KContext) (*contract.Response, error)
- func (c *Contract) Transfer(ctx contract.KContext) (*contract.Response, error)
- func (c *Contract) TransferFrom(ctx contract.KContext) (*contract.Response, error)
- func (c *Contract) Vote(ctx contract.KContext) (*contract.Response, error)
- type GenesisProposal
- type Manager
- type Proposal
- type XToken
- type XTokenConfig
Constants ¶
View Source
const ( ProposalVoting = iota + 1 // 从1开始。 ProposalSuccess ProposalFailure ProposalInvalid // 参与提案的总票数不足时,提案为此状态。 ProposalStopped // 提案投票结束 )
View Source
const ( NewToken = "NewToken" TotalSupply = "TotalSupply" BalanceOf = "BalanceOf" Transfer = "Transfer" TransferFrom = "TransferFrom" Approve = "Approve" Allowance = "Allowance" AddSupply = "AddSupply" Burn = "Burn" QueryToken = "QueryToken" QueryTokenOwner = "QueryTokenOwner" Propose = "Propose" Vote = "Vote" CheckVote = "CheckVote" StopVote = "StopVote" QueryProposal = "QueryProposal" QueryProposalVotes = "QueryProposalVotes" QueryTopic = "QueryTopic" AddAdmins = "AddAdmins" DelAdmins = "DelAdmins" QueryAdmins = "QueryAdmins" SetFee = "SetFee" GetFee = "GetFee" //Success 成功 Success = 200 )
View Source
const (
ConfigName = "engine.yaml"
)
View Source
const (
XTokenContract = "XToken"
)
Variables ¶
This section is empty.
Functions ¶
func KeyOfAdmins ¶
func KeyOfAdmins() string
func KeyOfAllowances ¶
func KeyOfID2AddressAgreeVotePrefix ¶
赞成票前缀
func KeyOfID2AddressOpposeVotePrefix ¶
反对票前缀
func KeyOfID2AddressWaiveVotePrefix ¶
弃权票前缀
func KeyOfLatestProposalID ¶
func KeyOfProposalResult ¶
此数据为异步计票结果得key不是交易生成的,因此为非交易读写集生成的。
func KeyOfProposer2Proposal ¶
用户发起的还未结束的提案,存储数据为提案ID以及用户锁定的余额,同一时间只会有同一个提案。
func KeyOfToken ¶
func KeyOfTokenOwner ¶
func KeyOfTokenProposal ¶
func KeyOfTopicData ¶
Types ¶
type CheckVoteResult ¶
type Context ¶
type Contract ¶
type Contract struct { Admins map[string]bool // 创世配置的或者节点配置文件写的,如果通过交易设置admin,此字段会作废。 Fees map[string]int64 // 创世配置的或者节点配置文件写的,如果通过交易设置fee,此字段会作废。 // contains filtered or unexported fields }
func NewContract ¶
func (*Contract) QueryAdmins ¶
func (*Contract) QueryProposal ¶
func (*Contract) QueryProposalVotes ¶
func (*Contract) QueryToken ¶
func (*Contract) QueryTokenOwner ¶
func (*Contract) TotalSupply ¶
func (*Contract) TransferFrom ¶
type GenesisProposal ¶
type XToken ¶
type XToken struct { Name string `json:"name"` TotalSupply *big.Int `json:"totalSupply"` AddSupplyEnabled bool `json:"addSupplyEnabled"` BurnEnabled bool `json:"burnEnabled"` Decimal uint64 `json:"decimal"` InitialAllocation map[string]*big.Int `json:"initialAllocation"` ConvertibleProportion *big.Int `json:"convertibleProportion"` GenesisProposal *GenesisProposal `json:"genesisProposal"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.