deposit

package
v1.0.5-hotfix1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2020 License: GPL-3.0, GPL-3.0 Imports: 20 Imported by: 0

README

保证金质押合约逻辑和操作方法

Mediator

申请成为Mediator
缴纳足额保证金,成为候选Mediator
退还保证金

普通持有PTN的用户

质押投票选举Mediator
变更选举的Mediator

用户可以随时修改Mediator的投票。

提取质押Token

##质押分红逻辑 质押分红以天为周期,每天根据前一天的质押数量情况,按比例分红。当天新增加的质押第二天才能参与分红。用户申请提取质押Token在分红结束后处理。

Documentation

Overview

Package deposit implements some functions for deposit contract.

Package deposit implements some functions for deposit contract.

记录了所有用户的质押充币、提币、分红等过程 最新状态集 Advance:形成流水日志,

Index

Constants

View Source
const ALL = "all"

Variables

This section is empty.

Functions

func DelJuryBalance added in v1.0.3

func DelJuryBalance(stub shim.ChaincodeStubInterface, addr string) error

删除Jury账户

func GetJuryBalance added in v1.0.3

func GetJuryBalance(stub shim.ChaincodeStubInterface, addr string) (*modules.JurorDeposit, error)

获取Jury账户

func UpperFirstChar added in v1.0.3

func UpperFirstChar(str string) string

将字符串的首字母大写

Types

type DepositChaincode

type DepositChaincode struct {
}

func (*DepositChaincode) ApplyBecomeMediator added in v1.0.4

func (d *DepositChaincode) ApplyBecomeMediator(stub shim.ChaincodeStubInterface, mediatorCreateArgs string) error

超级节点申请加入

func (DepositChaincode) ApplyForForfeitureDeposit added in v1.0.4

func (d DepositChaincode) ApplyForForfeitureDeposit(stub shim.ChaincodeStubInterface, forfeitureAddress string, role string, reason string) pb.Response

申请没收节点保证金

func (DepositChaincode) DeteleKey added in v1.0.5

func (*DepositChaincode) DevApplyQuit added in v1.0.4

func (d *DepositChaincode) DevApplyQuit(stub shim.ChaincodeStubInterface) pb.Response

开发者申请退出列表

func (*DepositChaincode) DeveloperPayToDepositContract added in v1.0.4

func (d *DepositChaincode) DeveloperPayToDepositContract(stub shim.ChaincodeStubInterface) pb.Response

开发者交付保证金

func (*DepositChaincode) GetAgreeForBecomeMediatorList added in v1.0.4

func (d *DepositChaincode) GetAgreeForBecomeMediatorList(stub shim.ChaincodeStubInterface) (map[string]bool, error)

func (DepositChaincode) GetAllJury added in v1.0.4

func (DepositChaincode) GetAllMediator added in v1.0.4

func (d DepositChaincode) GetAllMediator(stub shim.ChaincodeStubInterface) pb.Response

func (DepositChaincode) GetAllNode added in v1.0.4

func (*DepositChaincode) GetBecomeMediatorApplyList added in v1.0.4

func (d *DepositChaincode) GetBecomeMediatorApplyList(stub shim.ChaincodeStubInterface) (map[string]bool, error)

func (*DepositChaincode) GetJuryDeposit added in v1.0.4

func (d *DepositChaincode) GetJuryDeposit(stub shim.ChaincodeStubInterface, address string) (*modules.JuryDepositJson, error)

func (*DepositChaincode) GetListForDeveloper added in v1.0.4

func (d *DepositChaincode) GetListForDeveloper(stub shim.ChaincodeStubInterface) (map[string]bool, error)

func (*DepositChaincode) GetListForForfeitureApplication added in v1.0.4

func (d *DepositChaincode) GetListForForfeitureApplication(stub shim.ChaincodeStubInterface) pb.Response

func (*DepositChaincode) GetListForJuryCandidate added in v1.0.4

func (d *DepositChaincode) GetListForJuryCandidate(stub shim.ChaincodeStubInterface) (map[string]bool, error)

func (*DepositChaincode) GetListForMediatorCandidate added in v1.0.4

func (d *DepositChaincode) GetListForMediatorCandidate(stub shim.ChaincodeStubInterface) (map[string]bool, error)

func (*DepositChaincode) GetMediatorDeposit added in v1.0.4

func (d *DepositChaincode) GetMediatorDeposit(stub shim.ChaincodeStubInterface, address string) (*modules.MediatorDepositJson, error)

func (*DepositChaincode) GetNodeBalance added in v1.0.4

func (d *DepositChaincode) GetNodeBalance(stub shim.ChaincodeStubInterface, address string) (*modules.DepositBalanceJson, error)

func (*DepositChaincode) GetQuitApplyList added in v1.0.4

func (d *DepositChaincode) GetQuitApplyList(stub shim.ChaincodeStubInterface) pb.Response

func (*DepositChaincode) HandleForApplyBecomeMediator added in v1.0.4

func (d *DepositChaincode) HandleForApplyBecomeMediator(stub shim.ChaincodeStubInterface, address string, okOrNo string) pb.Response

基金会对申请加入Mediator进行处理

func (*DepositChaincode) HandleForApplyQuitDev added in v1.0.4

func (d *DepositChaincode) HandleForApplyQuitDev(stub shim.ChaincodeStubInterface, address string, okOrNo string) pb.Response

处理开发者申请退出列表

func (*DepositChaincode) HandleForApplyQuitJury added in v1.0.4

func (d *DepositChaincode) HandleForApplyQuitJury(stub shim.ChaincodeStubInterface, address string, okOrNo string) pb.Response

处理陪审员申请退出候选列表

func (*DepositChaincode) HandleForApplyQuitMediator added in v1.0.4

func (d *DepositChaincode) HandleForApplyQuitMediator(stub shim.ChaincodeStubInterface, address string, okOrNo string) pb.Response

基金会对申请退出Mediator进行处理

func (*DepositChaincode) HandleForForfeitureApplication added in v1.0.4

func (d *DepositChaincode) HandleForForfeitureApplication(stub shim.ChaincodeStubInterface, address string, okOrNo string) pb.Response

处理没收节点

func (DepositChaincode) HandleNodeRemoveFromAgreeList added in v1.0.4

func (d DepositChaincode) HandleNodeRemoveFromAgreeList(stub shim.ChaincodeStubInterface, address string) pb.Response

移除超级节点同意列表

func (DepositChaincode) HandlePledgeReward added in v1.0.4

func (d DepositChaincode) HandlePledgeReward(stub shim.ChaincodeStubInterface) pb.Response

func (*DepositChaincode) Init

func (*DepositChaincode) Invoke

func (DepositChaincode) IsFinishAddNewRecords added in v1.0.4

func (d DepositChaincode) IsFinishAddNewRecords(stub shim.ChaincodeStubInterface) bool

func (DepositChaincode) IsFinishAllocated added in v1.0.4

func (d DepositChaincode) IsFinishAllocated(stub shim.ChaincodeStubInterface) bool

func (*DepositChaincode) IsInAgreeList added in v1.0.4

func (d *DepositChaincode) IsInAgreeList(stub shim.ChaincodeStubInterface, address string) bool

func (*DepositChaincode) IsInBecomeList added in v1.0.4

func (d *DepositChaincode) IsInBecomeList(stub shim.ChaincodeStubInterface, address string) bool

func (*DepositChaincode) IsInDeveloperList added in v1.0.4

func (d *DepositChaincode) IsInDeveloperList(stub shim.ChaincodeStubInterface, address string) bool

func (*DepositChaincode) IsInForfeitureList added in v1.0.4

func (d *DepositChaincode) IsInForfeitureList(stub shim.ChaincodeStubInterface, address string) bool

func (*DepositChaincode) IsInJuryCandidateList added in v1.0.4

func (d *DepositChaincode) IsInJuryCandidateList(stub shim.ChaincodeStubInterface, address string) bool

func (*DepositChaincode) IsInMediatorCandidateList added in v1.0.4

func (d *DepositChaincode) IsInMediatorCandidateList(stub shim.ChaincodeStubInterface, address string) bool

func (*DepositChaincode) IsInQuitList added in v1.0.4

func (d *DepositChaincode) IsInQuitList(stub shim.ChaincodeStubInterface, address string) bool

func (*DepositChaincode) JuryApplyQuit added in v1.0.4

func (d *DepositChaincode) JuryApplyQuit(stub shim.ChaincodeStubInterface) pb.Response

陪审员申请退出候选列表

func (*DepositChaincode) JuryPayToDepositContract added in v1.0.4

func (d *DepositChaincode) JuryPayToDepositContract(stub shim.ChaincodeStubInterface, args string) pb.Response

陪审员交付保证金

func (*DepositChaincode) MediatorApplyQuit added in v1.0.4

func (d *DepositChaincode) MediatorApplyQuit(stub shim.ChaincodeStubInterface) pb.Response

超级节点申请退出候选列表

func (*DepositChaincode) MediatorPayToDepositContract added in v1.0.4

func (d *DepositChaincode) MediatorPayToDepositContract(stub shim.ChaincodeStubInterface) error

超级节点交付保证金

func (DepositChaincode) ProcessPledgeDeposit added in v1.0.4

func (d DepositChaincode) ProcessPledgeDeposit(stub shim.ChaincodeStubInterface) pb.Response

func (DepositChaincode) ProcessPledgeWithdraw added in v1.0.4

func (d DepositChaincode) ProcessPledgeWithdraw(stub shim.ChaincodeStubInterface, amount string) pb.Response

func (DepositChaincode) QueryAllPledgeHistory added in v1.0.4

func (d DepositChaincode) QueryAllPledgeHistory(stub shim.ChaincodeStubInterface) ([]*modules.PledgeList, error)

func (DepositChaincode) QueryPledgeList added in v1.0.4

func (DepositChaincode) QueryPledgeListByDate added in v1.0.4

func (d DepositChaincode) QueryPledgeListByDate(stub shim.ChaincodeStubInterface, date string) (*modules.PledgeList, error)

func (DepositChaincode) QueryPledgeStatusByAddr added in v1.0.4

func (d DepositChaincode) QueryPledgeStatusByAddr(stub shim.ChaincodeStubInterface, address string) (*modules.PledgeStatusJson, error)

func (DepositChaincode) QueryPledgeWithdraw added in v1.0.4

func (d DepositChaincode) QueryPledgeWithdraw(stub shim.ChaincodeStubInterface) ([]*modules.AddressAmount, error)

func (DepositChaincode) UpdateKeyValue added in v1.0.5

func (d DepositChaincode) UpdateKeyValue(stub shim.ChaincodeStubInterface, key, value string) pb.Response

更新某个key

func (*DepositChaincode) UpdateMediatorInfo added in v1.0.1

func (d *DepositChaincode) UpdateMediatorInfo(stub shim.ChaincodeStubInterface, mediatorUpdateArgs string) pb.Response

超级节点更新信息

type JurorUpdateArgs added in v1.0.4

type JurorUpdateArgs struct {
	RewardAddr *string `json:"reward_address"` // 奖励地址,用于奖励
}

更新 juror 信息所需参数

Jump to

Keyboard shortcuts

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