systemSmartContracts

package
v1.0.115 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthAuction        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowAuction          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupAuction = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthEsdt        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowEsdt          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupEsdt = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthStaking        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowStaking          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupStaking = fmt.Errorf("proto: unexpected end of group")
)

Functions

func CheckIfNil

func CheckIfNil(args *vmcommon.ContractCallInput) error

CheckIfNil verifies if contract call input is not nil

func NewESDTSmartContract added in v1.0.114

func NewESDTSmartContract(args ArgsNewESDTSmartContract) (*esdt, error)

NewESDTSmartContract creates the esdt smart contract, which controls the issuing of tokens

func NewStakingAuctionSmartContract

func NewStakingAuctionSmartContract(
	args ArgsStakingAuctionSmartContract,
) (*stakingAuctionSC, error)

NewStakingAuctionSmartContract creates an auction smart contract

func NewStakingSmartContract

func NewStakingSmartContract(
	args ArgsNewStakingSmartContract,
) (*stakingSC, error)

NewStakingSmartContract creates a staking smart contract

func NewVMContext

func NewVMContext(
	blockChainHook vmcommon.BlockchainHook,
	cryptoHook vmcommon.CryptoHook,
	inputParser vm.ArgumentsParser,
	validatorAccountsDB state.AccountsAdapter,
) (*vmContext, error)

NewVMContext creates a context where smart contracts can run and write

Types

type ArgsNewESDTSmartContract added in v1.0.114

type ArgsNewESDTSmartContract struct {
	Eei           vm.SystemEI
	GasCost       vm.GasCost
	ESDTSCConfig  config.ESDTSystemSCConfig
	ESDTSCAddress []byte
	Marshalizer   marshal.Marshalizer
	Hasher        hashing.Hasher
}

ArgsNewESDTSmartContract defines the arguments needed for the esdt contract

type ArgsNewStakingSmartContract

type ArgsNewStakingSmartContract struct {
	MinNumNodes              uint32
	MinStakeValue            *big.Int
	UnBondPeriod             uint64
	Eei                      vm.SystemEI
	StakingAccessAddr        []byte
	JailAccessAddr           []byte
	NumRoundsWithoutBleed    uint64
	BleedPercentagePerRound  float64
	MaximumPercentageToBleed float64
	GasCost                  vm.GasCost
}

ArgsNewStakingSmartContract holds the arguments needed to create a StakingSmartContract

type ArgsStakingAuctionSmartContract

type ArgsStakingAuctionSmartContract struct {
	NodesConfigProvider vm.NodesConfigProvider
	ValidatorSettings   vm.ValidatorSettingsHandler
	Eei                 vm.SystemEI
	SigVerifier         vm.MessageSignVerifier
	StakingSCAddress    []byte
	AuctionSCAddress    []byte
	GasCost             vm.GasCost
}

ArgsStakingAuctionSmartContract is the arguments structure to create a new StakingAuctionSmartContract

type AuctionConfig

type AuctionConfig struct {
	NumNodes      uint32        `protobuf:"varint,1,opt,name=NumNodes,proto3" json:"NumNodes"`
	MinStakeValue *math_big.Int `` /* 148-byte string literal not displayed */
	TotalSupply   *math_big.Int `` /* 144-byte string literal not displayed */
	MinStep       *math_big.Int `` /* 136-byte string literal not displayed */
	NodePrice     *math_big.Int `` /* 140-byte string literal not displayed */
	UnJailPrice   *math_big.Int `` /* 144-byte string literal not displayed */
}

func (*AuctionConfig) Descriptor added in v1.0.114

func (*AuctionConfig) Descriptor() ([]byte, []int)

func (*AuctionConfig) Equal added in v1.0.114

func (this *AuctionConfig) Equal(that interface{}) bool

func (*AuctionConfig) GetMinStakeValue added in v1.0.114

func (m *AuctionConfig) GetMinStakeValue() *math_big.Int

func (*AuctionConfig) GetMinStep added in v1.0.114

func (m *AuctionConfig) GetMinStep() *math_big.Int

func (*AuctionConfig) GetNodePrice added in v1.0.114

func (m *AuctionConfig) GetNodePrice() *math_big.Int

func (*AuctionConfig) GetNumNodes added in v1.0.114

func (m *AuctionConfig) GetNumNodes() uint32

func (*AuctionConfig) GetTotalSupply added in v1.0.114

func (m *AuctionConfig) GetTotalSupply() *math_big.Int

func (*AuctionConfig) GetUnJailPrice added in v1.0.114

func (m *AuctionConfig) GetUnJailPrice() *math_big.Int

func (*AuctionConfig) GoString added in v1.0.114

func (this *AuctionConfig) GoString() string

func (*AuctionConfig) Marshal added in v1.0.114

func (m *AuctionConfig) Marshal() (dAtA []byte, err error)

func (*AuctionConfig) MarshalTo added in v1.0.114

func (m *AuctionConfig) MarshalTo(dAtA []byte) (int, error)

func (*AuctionConfig) MarshalToSizedBuffer added in v1.0.114

func (m *AuctionConfig) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AuctionConfig) ProtoMessage added in v1.0.114

func (*AuctionConfig) ProtoMessage()

func (*AuctionConfig) Reset added in v1.0.114

func (m *AuctionConfig) Reset()

func (*AuctionConfig) Size added in v1.0.114

func (m *AuctionConfig) Size() (n int)

func (*AuctionConfig) String added in v1.0.114

func (this *AuctionConfig) String() string

func (*AuctionConfig) Unmarshal added in v1.0.114

func (m *AuctionConfig) Unmarshal(dAtA []byte) error

func (*AuctionConfig) XXX_DiscardUnknown added in v1.0.114

func (m *AuctionConfig) XXX_DiscardUnknown()

func (*AuctionConfig) XXX_Marshal added in v1.0.114

func (m *AuctionConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AuctionConfig) XXX_Merge added in v1.0.114

func (m *AuctionConfig) XXX_Merge(src proto.Message)

func (*AuctionConfig) XXX_Size added in v1.0.114

func (m *AuctionConfig) XXX_Size() int

func (*AuctionConfig) XXX_Unmarshal added in v1.0.114

func (m *AuctionConfig) XXX_Unmarshal(b []byte) error

type AuctionData

type AuctionData struct {
	RegisterNonce   uint64        `protobuf:"varint,1,opt,name=RegisterNonce,proto3" json:"RegisterNonce"`
	Epoch           uint32        `protobuf:"varint,2,opt,name=Epoch,proto3" json:"Epoch"`
	RewardAddress   []byte        `protobuf:"bytes,3,opt,name=RewardAddress,proto3" json:"RewardAddress"`
	TotalStakeValue *math_big.Int `` /* 152-byte string literal not displayed */
	LockedStake     *math_big.Int `` /* 144-byte string literal not displayed */
	MaxStakePerNode *math_big.Int `` /* 152-byte string literal not displayed */
	BlsPubKeys      [][]byte      `protobuf:"bytes,7,rep,name=BlsPubKeys,proto3" json:"BlsPubKeys"`
}

func (*AuctionData) Descriptor added in v1.0.114

func (*AuctionData) Descriptor() ([]byte, []int)

func (*AuctionData) Equal added in v1.0.114

func (this *AuctionData) Equal(that interface{}) bool

func (*AuctionData) GetBlsPubKeys added in v1.0.114

func (m *AuctionData) GetBlsPubKeys() [][]byte

func (*AuctionData) GetEpoch added in v1.0.114

func (m *AuctionData) GetEpoch() uint32

func (*AuctionData) GetLockedStake added in v1.0.114

func (m *AuctionData) GetLockedStake() *math_big.Int

func (*AuctionData) GetMaxStakePerNode added in v1.0.114

func (m *AuctionData) GetMaxStakePerNode() *math_big.Int

func (*AuctionData) GetRegisterNonce added in v1.0.114

func (m *AuctionData) GetRegisterNonce() uint64

func (*AuctionData) GetRewardAddress added in v1.0.114

func (m *AuctionData) GetRewardAddress() []byte

func (*AuctionData) GetTotalStakeValue added in v1.0.114

func (m *AuctionData) GetTotalStakeValue() *math_big.Int

func (*AuctionData) GoString added in v1.0.114

func (this *AuctionData) GoString() string

func (*AuctionData) Marshal added in v1.0.114

func (m *AuctionData) Marshal() (dAtA []byte, err error)

func (*AuctionData) MarshalTo added in v1.0.114

func (m *AuctionData) MarshalTo(dAtA []byte) (int, error)

func (*AuctionData) MarshalToSizedBuffer added in v1.0.114

func (m *AuctionData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AuctionData) ProtoMessage added in v1.0.114

func (*AuctionData) ProtoMessage()

func (*AuctionData) Reset added in v1.0.114

func (m *AuctionData) Reset()

func (*AuctionData) Size added in v1.0.114

func (m *AuctionData) Size() (n int)

func (*AuctionData) String added in v1.0.114

func (this *AuctionData) String() string

func (*AuctionData) Unmarshal added in v1.0.114

func (m *AuctionData) Unmarshal(dAtA []byte) error

func (*AuctionData) XXX_DiscardUnknown added in v1.0.114

func (m *AuctionData) XXX_DiscardUnknown()

func (*AuctionData) XXX_Marshal added in v1.0.114

func (m *AuctionData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AuctionData) XXX_Merge added in v1.0.114

func (m *AuctionData) XXX_Merge(src proto.Message)

func (*AuctionData) XXX_Size added in v1.0.114

func (m *AuctionData) XXX_Size() int

func (*AuctionData) XXX_Unmarshal added in v1.0.114

func (m *AuctionData) XXX_Unmarshal(b []byte) error

type ESDTConfig added in v1.0.114

type ESDTConfig struct {
	OwnerAddress       []byte        `protobuf:"bytes,1,opt,name=OwnerAddress,proto3" json:"OwnerAddress"`
	BaseIssuingCost    *math_big.Int `` /* 152-byte string literal not displayed */
	MinTokenNameLength uint32        `protobuf:"varint,3,opt,name=MinTokenNameLength,proto3" json:"MinTokenNameLength"`
	MaxTokenNameLength uint32        `protobuf:"varint,4,opt,name=MaxTokenNameLength,proto3" json:"MaxTokenNameLength"`
}

func (*ESDTConfig) Descriptor added in v1.0.114

func (*ESDTConfig) Descriptor() ([]byte, []int)

func (*ESDTConfig) Equal added in v1.0.114

func (this *ESDTConfig) Equal(that interface{}) bool

func (*ESDTConfig) GetBaseIssuingCost added in v1.0.114

func (m *ESDTConfig) GetBaseIssuingCost() *math_big.Int

func (*ESDTConfig) GetMaxTokenNameLength added in v1.0.114

func (m *ESDTConfig) GetMaxTokenNameLength() uint32

func (*ESDTConfig) GetMinTokenNameLength added in v1.0.114

func (m *ESDTConfig) GetMinTokenNameLength() uint32

func (*ESDTConfig) GetOwnerAddress added in v1.0.114

func (m *ESDTConfig) GetOwnerAddress() []byte

func (*ESDTConfig) GoString added in v1.0.114

func (this *ESDTConfig) GoString() string

func (*ESDTConfig) Marshal added in v1.0.114

func (m *ESDTConfig) Marshal() (dAtA []byte, err error)

func (*ESDTConfig) MarshalTo added in v1.0.114

func (m *ESDTConfig) MarshalTo(dAtA []byte) (int, error)

func (*ESDTConfig) MarshalToSizedBuffer added in v1.0.114

func (m *ESDTConfig) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ESDTConfig) ProtoMessage added in v1.0.114

func (*ESDTConfig) ProtoMessage()

func (*ESDTConfig) Reset added in v1.0.114

func (m *ESDTConfig) Reset()

func (*ESDTConfig) Size added in v1.0.114

func (m *ESDTConfig) Size() (n int)

func (*ESDTConfig) String added in v1.0.114

func (this *ESDTConfig) String() string

func (*ESDTConfig) Unmarshal added in v1.0.114

func (m *ESDTConfig) Unmarshal(dAtA []byte) error

func (*ESDTConfig) XXX_DiscardUnknown added in v1.0.114

func (m *ESDTConfig) XXX_DiscardUnknown()

func (*ESDTConfig) XXX_Marshal added in v1.0.114

func (m *ESDTConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ESDTConfig) XXX_Merge added in v1.0.114

func (m *ESDTConfig) XXX_Merge(src proto.Message)

func (*ESDTConfig) XXX_Size added in v1.0.114

func (m *ESDTConfig) XXX_Size() int

func (*ESDTConfig) XXX_Unmarshal added in v1.0.114

func (m *ESDTConfig) XXX_Unmarshal(b []byte) error

type ESDTData added in v1.0.114

type ESDTData struct {
	IssuerAddress []byte        `protobuf:"bytes,1,opt,name=IssuerAddress,proto3" json:"IssuerAddress"`
	TokenName     []byte        `protobuf:"bytes,2,opt,name=TokenName,proto3" json:"TokenName"`
	Mintable      bool          `protobuf:"varint,3,opt,name=Mintable,proto3" json:"Mintable"`
	Burnable      bool          `protobuf:"varint,4,opt,name=Burnable,proto3" json:"Burnable"`
	CanPause      bool          `protobuf:"varint,5,opt,name=CanPause,proto3" json:"CanPause"`
	Paused        bool          `protobuf:"varint,6,opt,name=Paused,proto3" json:"Paused"`
	CanFreeze     bool          `protobuf:"varint,7,opt,name=CanFreeze,proto3" json:"CanFreeze"`
	CanWipe       bool          `protobuf:"varint,8,opt,name=CanWipe,proto3" json:"CanWipe"`
	MintedValue   *math_big.Int `` /* 144-byte string literal not displayed */
	BurntValue    *math_big.Int `` /* 143-byte string literal not displayed */
}

func (*ESDTData) Descriptor added in v1.0.114

func (*ESDTData) Descriptor() ([]byte, []int)

func (*ESDTData) Equal added in v1.0.114

func (this *ESDTData) Equal(that interface{}) bool

func (*ESDTData) GetBurnable added in v1.0.114

func (m *ESDTData) GetBurnable() bool

func (*ESDTData) GetBurntValue added in v1.0.114

func (m *ESDTData) GetBurntValue() *math_big.Int

func (*ESDTData) GetCanFreeze added in v1.0.114

func (m *ESDTData) GetCanFreeze() bool

func (*ESDTData) GetCanPause added in v1.0.114

func (m *ESDTData) GetCanPause() bool

func (*ESDTData) GetCanWipe added in v1.0.114

func (m *ESDTData) GetCanWipe() bool

func (*ESDTData) GetIssuerAddress added in v1.0.114

func (m *ESDTData) GetIssuerAddress() []byte

func (*ESDTData) GetMintable added in v1.0.114

func (m *ESDTData) GetMintable() bool

func (*ESDTData) GetMintedValue added in v1.0.114

func (m *ESDTData) GetMintedValue() *math_big.Int

func (*ESDTData) GetPaused added in v1.0.114

func (m *ESDTData) GetPaused() bool

func (*ESDTData) GetTokenName added in v1.0.114

func (m *ESDTData) GetTokenName() []byte

func (*ESDTData) GoString added in v1.0.114

func (this *ESDTData) GoString() string

func (*ESDTData) Marshal added in v1.0.114

func (m *ESDTData) Marshal() (dAtA []byte, err error)

func (*ESDTData) MarshalTo added in v1.0.114

func (m *ESDTData) MarshalTo(dAtA []byte) (int, error)

func (*ESDTData) MarshalToSizedBuffer added in v1.0.114

func (m *ESDTData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ESDTData) ProtoMessage added in v1.0.114

func (*ESDTData) ProtoMessage()

func (*ESDTData) Reset added in v1.0.114

func (m *ESDTData) Reset()

func (*ESDTData) Size added in v1.0.114

func (m *ESDTData) Size() (n int)

func (*ESDTData) String added in v1.0.114

func (this *ESDTData) String() string

func (*ESDTData) Unmarshal added in v1.0.114

func (m *ESDTData) Unmarshal(dAtA []byte) error

func (*ESDTData) XXX_DiscardUnknown added in v1.0.114

func (m *ESDTData) XXX_DiscardUnknown()

func (*ESDTData) XXX_Marshal added in v1.0.114

func (m *ESDTData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ESDTData) XXX_Merge added in v1.0.114

func (m *ESDTData) XXX_Merge(src proto.Message)

func (*ESDTData) XXX_Size added in v1.0.114

func (m *ESDTData) XXX_Size() int

func (*ESDTData) XXX_Unmarshal added in v1.0.114

func (m *ESDTData) XXX_Unmarshal(b []byte) error

type StakedData

type StakedData struct {
	RegisterNonce uint64        `protobuf:"varint,1,opt,name=RegisterNonce,proto3" json:"RegisterNonce"`
	Staked        bool          `protobuf:"varint,2,opt,name=Staked,proto3" json:"Staked"`
	UnStakedNonce uint64        `protobuf:"varint,3,opt,name=UnStakedNonce,proto3" json:"UnStakedNonce"`
	UnStakedEpoch uint32        `protobuf:"varint,6,opt,name=UnStakedEpoch,proto3" json:"UnStakedEpoch"`
	RewardAddress []byte        `protobuf:"bytes,4,opt,name=RewardAddress,proto3" json:"RewardAddress"`
	StakeValue    *math_big.Int `` /* 142-byte string literal not displayed */
	JailedRound   uint64        `protobuf:"varint,7,opt,name=JailedRound,proto3" json:"JailedRound"`
	JailedNonce   uint64        `protobuf:"varint,8,opt,name=JailedNonce,proto3" json:"JailedNonce"`
	UnJailedNonce uint64        `protobuf:"varint,9,opt,name=UnJailedNonce,proto3" json:"UnJailedNonce"`
}

func (*StakedData) Descriptor

func (*StakedData) Descriptor() ([]byte, []int)

func (*StakedData) Equal

func (this *StakedData) Equal(that interface{}) bool

func (*StakedData) GetJailedNonce added in v1.0.110

func (m *StakedData) GetJailedNonce() uint64

func (*StakedData) GetJailedRound

func (m *StakedData) GetJailedRound() uint64

func (*StakedData) GetRegisterNonce

func (m *StakedData) GetRegisterNonce() uint64

func (*StakedData) GetRewardAddress

func (m *StakedData) GetRewardAddress() []byte

func (*StakedData) GetStakeValue

func (m *StakedData) GetStakeValue() *math_big.Int

func (*StakedData) GetStaked

func (m *StakedData) GetStaked() bool

func (*StakedData) GetUnJailedNonce added in v1.0.110

func (m *StakedData) GetUnJailedNonce() uint64

func (*StakedData) GetUnStakedEpoch

func (m *StakedData) GetUnStakedEpoch() uint32

func (*StakedData) GetUnStakedNonce

func (m *StakedData) GetUnStakedNonce() uint64

func (*StakedData) GoString

func (this *StakedData) GoString() string

func (*StakedData) Marshal

func (m *StakedData) Marshal() (dAtA []byte, err error)

func (*StakedData) MarshalTo

func (m *StakedData) MarshalTo(dAtA []byte) (int, error)

func (*StakedData) MarshalToSizedBuffer

func (m *StakedData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*StakedData) ProtoMessage

func (*StakedData) ProtoMessage()

func (*StakedData) Reset

func (m *StakedData) Reset()

func (*StakedData) Size

func (m *StakedData) Size() (n int)

func (*StakedData) String

func (this *StakedData) String() string

func (*StakedData) Unmarshal

func (m *StakedData) Unmarshal(dAtA []byte) error

func (*StakedData) XXX_DiscardUnknown

func (m *StakedData) XXX_DiscardUnknown()

func (*StakedData) XXX_Marshal

func (m *StakedData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StakedData) XXX_Merge

func (m *StakedData) XXX_Merge(src proto.Message)

func (*StakedData) XXX_Size

func (m *StakedData) XXX_Size() int

func (*StakedData) XXX_Unmarshal

func (m *StakedData) XXX_Unmarshal(b []byte) error

type StakingNodesConfig added in v1.0.110

type StakingNodesConfig struct {
	MinNumNodes int64 `protobuf:"varint,1,opt,name=MinNumNodes,proto3" json:"MinNumNodes"`
	StakedNodes int64 `protobuf:"varint,2,opt,name=StakedNodes,proto3" json:"StakedNodes"`
	JailedNodes int64 `protobuf:"varint,3,opt,name=JailedNodes,proto3" json:"JailedNodes"`
}

func (*StakingNodesConfig) Descriptor added in v1.0.114

func (*StakingNodesConfig) Descriptor() ([]byte, []int)

func (*StakingNodesConfig) Equal added in v1.0.114

func (this *StakingNodesConfig) Equal(that interface{}) bool

func (*StakingNodesConfig) GetJailedNodes added in v1.0.114

func (m *StakingNodesConfig) GetJailedNodes() int64

func (*StakingNodesConfig) GetMinNumNodes added in v1.0.114

func (m *StakingNodesConfig) GetMinNumNodes() int64

func (*StakingNodesConfig) GetStakedNodes added in v1.0.114

func (m *StakingNodesConfig) GetStakedNodes() int64

func (*StakingNodesConfig) GoString added in v1.0.114

func (this *StakingNodesConfig) GoString() string

func (*StakingNodesConfig) Marshal added in v1.0.114

func (m *StakingNodesConfig) Marshal() (dAtA []byte, err error)

func (*StakingNodesConfig) MarshalTo added in v1.0.114

func (m *StakingNodesConfig) MarshalTo(dAtA []byte) (int, error)

func (*StakingNodesConfig) MarshalToSizedBuffer added in v1.0.114

func (m *StakingNodesConfig) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*StakingNodesConfig) ProtoMessage added in v1.0.114

func (*StakingNodesConfig) ProtoMessage()

func (*StakingNodesConfig) Reset added in v1.0.114

func (m *StakingNodesConfig) Reset()

func (*StakingNodesConfig) Size added in v1.0.114

func (m *StakingNodesConfig) Size() (n int)

func (*StakingNodesConfig) String added in v1.0.114

func (this *StakingNodesConfig) String() string

func (*StakingNodesConfig) Unmarshal added in v1.0.114

func (m *StakingNodesConfig) Unmarshal(dAtA []byte) error

func (*StakingNodesConfig) XXX_DiscardUnknown added in v1.0.114

func (m *StakingNodesConfig) XXX_DiscardUnknown()

func (*StakingNodesConfig) XXX_Marshal added in v1.0.114

func (m *StakingNodesConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StakingNodesConfig) XXX_Merge added in v1.0.114

func (m *StakingNodesConfig) XXX_Merge(src proto.Message)

func (*StakingNodesConfig) XXX_Size added in v1.0.114

func (m *StakingNodesConfig) XXX_Size() int

func (*StakingNodesConfig) XXX_Unmarshal added in v1.0.114

func (m *StakingNodesConfig) XXX_Unmarshal(b []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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