dividend

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2021 License: Apache-2.0, BSD-2-Clause, Apache-2.0, + 1 more Imports: 1 Imported by: 0

README

dividend

Simple dividend smart contract

  • Allows for setting up automatic dividend dispersal to a number of recipients according to distribution factors per recipient. Any tokens sent to this contract will automatically be divided accordingly over these recipients.

Documentation

Index

Constants

View Source
const (
	ScName        = "dividend"
	ScDescription = "Simple dividend smart contract"
	HScName       = wasmlib.ScHname(0xcce2e239)
)
View Source
const (
	ParamAddress = wasmlib.Key("address")
	ParamFactor  = wasmlib.Key("factor")
	ParamOwner   = wasmlib.Key("owner")
)
View Source
const (
	ResultFactor = wasmlib.Key("factor")
	ResultOwner  = wasmlib.Key("owner")
)
View Source
const (
	StateMemberList  = wasmlib.Key("memberList")
	StateMembers     = wasmlib.Key("members")
	StateOwner       = wasmlib.Key("owner")
	StateTotalFactor = wasmlib.Key("totalFactor")
)
View Source
const (
	FuncDivide    = "divide"
	FuncInit      = "init"
	FuncMember    = "member"
	FuncSetOwner  = "setOwner"
	ViewGetFactor = "getFactor"
	ViewGetOwner  = "getOwner"
)
View Source
const (
	HFuncDivide    = wasmlib.ScHname(0xc7878107)
	HFuncInit      = wasmlib.ScHname(0x1f44d644)
	HFuncMember    = wasmlib.ScHname(0xc07da2cb)
	HFuncSetOwner  = wasmlib.ScHname(0x2a15fe7b)
	HViewGetFactor = wasmlib.ScHname(0x0ee668fe)
	HViewGetOwner  = wasmlib.ScHname(0x137107a6)
)
View Source
const (
	IdxParamAddress     = 0
	IdxParamFactor      = 1
	IdxParamOwner       = 2
	IdxResultFactor     = 3
	IdxResultOwner      = 4
	IdxStateMemberList  = 5
	IdxStateMembers     = 6
	IdxStateOwner       = 7
	IdxStateTotalFactor = 8
)

Variables

This section is empty.

Functions

func OnLoad

func OnLoad()

Types

type ArrayOfImmutableAddress

type ArrayOfImmutableAddress struct {
	// contains filtered or unexported fields
}

func (ArrayOfImmutableAddress) GetAddress

func (ArrayOfImmutableAddress) Length

func (a ArrayOfImmutableAddress) Length() int32

type ArrayOfMutableAddress

type ArrayOfMutableAddress struct {
	// contains filtered or unexported fields
}

func (ArrayOfMutableAddress) Clear

func (a ArrayOfMutableAddress) Clear()

func (ArrayOfMutableAddress) GetAddress

func (ArrayOfMutableAddress) Length

func (a ArrayOfMutableAddress) Length() int32

type DivideCall

type DivideCall struct {
	Func *wasmlib.ScFunc
}

type DivideContext

type DivideContext struct {
	State MutableDividendState
}

type Funcs

type Funcs struct{}
var ScFuncs Funcs

func (Funcs) Divide

func (sc Funcs) Divide(ctx wasmlib.ScFuncCallContext) *DivideCall

func (Funcs) GetFactor

func (sc Funcs) GetFactor(ctx wasmlib.ScViewCallContext) *GetFactorCall

func (Funcs) GetOwner

func (sc Funcs) GetOwner(ctx wasmlib.ScViewCallContext) *GetOwnerCall

func (Funcs) Init

func (sc Funcs) Init(ctx wasmlib.ScFuncCallContext) *InitCall

func (Funcs) Member

func (sc Funcs) Member(ctx wasmlib.ScFuncCallContext) *MemberCall

func (Funcs) SetOwner

func (sc Funcs) SetOwner(ctx wasmlib.ScFuncCallContext) *SetOwnerCall

type GetFactorCall

type GetFactorCall struct {
	Func    *wasmlib.ScView
	Params  MutableGetFactorParams
	Results ImmutableGetFactorResults
}

type GetFactorContext

type GetFactorContext struct {
	Params  ImmutableGetFactorParams
	Results MutableGetFactorResults
	State   ImmutableDividendState
}

type GetOwnerCall

type GetOwnerCall struct {
	Func    *wasmlib.ScView
	Results ImmutableGetOwnerResults
}

type GetOwnerContext

type GetOwnerContext struct {
	Results MutableGetOwnerResults
	State   ImmutableDividendState
}

type ImmutableDividendState

type ImmutableDividendState struct {
	// contains filtered or unexported fields
}

func (ImmutableDividendState) MemberList

func (ImmutableDividendState) Members

func (ImmutableDividendState) Owner

func (ImmutableDividendState) TotalFactor

type ImmutableGetFactorParams

type ImmutableGetFactorParams struct {
	// contains filtered or unexported fields
}

func (ImmutableGetFactorParams) Address

type ImmutableGetFactorResults

type ImmutableGetFactorResults struct {
	// contains filtered or unexported fields
}

func (ImmutableGetFactorResults) Factor

type ImmutableGetOwnerResults

type ImmutableGetOwnerResults struct {
	// contains filtered or unexported fields
}

func (ImmutableGetOwnerResults) Owner

type ImmutableInitParams

type ImmutableInitParams struct {
	// contains filtered or unexported fields
}

func (ImmutableInitParams) Owner

type ImmutableMemberParams

type ImmutableMemberParams struct {
	// contains filtered or unexported fields
}

func (ImmutableMemberParams) Address

func (ImmutableMemberParams) Factor

type ImmutableSetOwnerParams

type ImmutableSetOwnerParams struct {
	// contains filtered or unexported fields
}

func (ImmutableSetOwnerParams) Owner

type InitCall

type InitCall struct {
	Func   *wasmlib.ScInitFunc
	Params MutableInitParams
}

type InitContext

type InitContext struct {
	Params ImmutableInitParams
	State  MutableDividendState
}

type MapAddressToImmutableInt64

type MapAddressToImmutableInt64 struct {
	// contains filtered or unexported fields
}

func (MapAddressToImmutableInt64) GetInt64

type MapAddressToMutableInt64

type MapAddressToMutableInt64 struct {
	// contains filtered or unexported fields
}

func (MapAddressToMutableInt64) Clear

func (m MapAddressToMutableInt64) Clear()

func (MapAddressToMutableInt64) GetInt64

type MemberCall

type MemberCall struct {
	Func   *wasmlib.ScFunc
	Params MutableMemberParams
}

type MemberContext

type MemberContext struct {
	Params ImmutableMemberParams
	State  MutableDividendState
}

type MutableDividendState

type MutableDividendState struct {
	// contains filtered or unexported fields
}

func (MutableDividendState) MemberList

func (MutableDividendState) Members

func (MutableDividendState) Owner

func (MutableDividendState) TotalFactor

type MutableGetFactorParams

type MutableGetFactorParams struct {
	// contains filtered or unexported fields
}

func (MutableGetFactorParams) Address

type MutableGetFactorResults

type MutableGetFactorResults struct {
	// contains filtered or unexported fields
}

func (MutableGetFactorResults) Factor

type MutableGetOwnerResults

type MutableGetOwnerResults struct {
	// contains filtered or unexported fields
}

func (MutableGetOwnerResults) Owner

type MutableInitParams

type MutableInitParams struct {
	// contains filtered or unexported fields
}

func (MutableInitParams) Owner

type MutableMemberParams

type MutableMemberParams struct {
	// contains filtered or unexported fields
}

func (MutableMemberParams) Address

func (MutableMemberParams) Factor

type MutableSetOwnerParams

type MutableSetOwnerParams struct {
	// contains filtered or unexported fields
}

func (MutableSetOwnerParams) Owner

type SetOwnerCall

type SetOwnerCall struct {
	Func   *wasmlib.ScFunc
	Params MutableSetOwnerParams
}

type SetOwnerContext

type SetOwnerContext struct {
	Params ImmutableSetOwnerParams
	State  MutableDividendState
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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