erc20

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

ERC-20 as IOTA smart contract

ISCP version of ERC-20, the on-contract token ledger.

Documentation

Index

Constants

View Source
const (
	ScName        = "erc20"
	ScDescription = "ERC-20 PoC for IOTA Smart Contracts"
	HScName       = wasmlib.ScHname(0x200e3733)
)
View Source
const (
	ParamAccount    = wasmlib.Key("ac")
	ParamAmount     = wasmlib.Key("am")
	ParamCreator    = wasmlib.Key("c")
	ParamDelegation = wasmlib.Key("d")
	ParamRecipient  = wasmlib.Key("r")
	ParamSupply     = wasmlib.Key("s")
)
View Source
const (
	ResultAmount = wasmlib.Key("am")
	ResultSupply = wasmlib.Key("s")
)
View Source
const (
	StateAllAllowances = wasmlib.Key("a")
	StateBalances      = wasmlib.Key("b")
	StateSupply        = wasmlib.Key("s")
)
View Source
const (
	FuncApprove      = "approve"
	FuncInit         = "init"
	FuncTransfer     = "transfer"
	FuncTransferFrom = "transferFrom"
	ViewAllowance    = "allowance"
	ViewBalanceOf    = "balanceOf"
	ViewTotalSupply  = "totalSupply"
)
View Source
const (
	HFuncApprove      = wasmlib.ScHname(0xa0661268)
	HFuncInit         = wasmlib.ScHname(0x1f44d644)
	HFuncTransfer     = wasmlib.ScHname(0xa15da184)
	HFuncTransferFrom = wasmlib.ScHname(0xd5e0a602)
	HViewAllowance    = wasmlib.ScHname(0x5e16006a)
	HViewBalanceOf    = wasmlib.ScHname(0x67ef8df4)
	HViewTotalSupply  = wasmlib.ScHname(0x9505e6ca)
)
View Source
const (
	IdxParamAccount       = 0
	IdxParamAmount        = 1
	IdxParamCreator       = 2
	IdxParamDelegation    = 3
	IdxParamRecipient     = 4
	IdxParamSupply        = 5
	IdxResultAmount       = 6
	IdxResultSupply       = 7
	IdxStateAllAllowances = 8
	IdxStateBalances      = 9
	IdxStateSupply        = 10
)

Variables

This section is empty.

Functions

func OnLoad

func OnLoad()

Types

type AllowanceCall

type AllowanceCall struct {
	Func    *wasmlib.ScView
	Params  MutableAllowanceParams
	Results ImmutableAllowanceResults
}

type AllowanceContext

type AllowanceContext struct {
	Params  ImmutableAllowanceParams
	Results MutableAllowanceResults
	State   ImmutableErc20State
}

type ApproveCall

type ApproveCall struct {
	Func   *wasmlib.ScFunc
	Params MutableApproveParams
}

type ApproveContext

type ApproveContext struct {
	Params ImmutableApproveParams
	State  MutableErc20State
}

type BalanceOfCall

type BalanceOfCall struct {
	Func    *wasmlib.ScView
	Params  MutableBalanceOfParams
	Results ImmutableBalanceOfResults
}

type BalanceOfContext

type BalanceOfContext struct {
	Params  ImmutableBalanceOfParams
	Results MutableBalanceOfResults
	State   ImmutableErc20State
}

type Funcs

type Funcs struct{}
var ScFuncs Funcs

func (Funcs) Allowance

func (sc Funcs) Allowance(ctx wasmlib.ScViewCallContext) *AllowanceCall

func (Funcs) Approve

func (sc Funcs) Approve(ctx wasmlib.ScFuncCallContext) *ApproveCall

func (Funcs) BalanceOf

func (sc Funcs) BalanceOf(ctx wasmlib.ScViewCallContext) *BalanceOfCall

func (Funcs) Init

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

func (Funcs) TotalSupply

func (sc Funcs) TotalSupply(ctx wasmlib.ScViewCallContext) *TotalSupplyCall

func (Funcs) Transfer

func (sc Funcs) Transfer(ctx wasmlib.ScFuncCallContext) *TransferCall

func (Funcs) TransferFrom

func (sc Funcs) TransferFrom(ctx wasmlib.ScFuncCallContext) *TransferFromCall

type ImmutableAllowanceParams

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

func (ImmutableAllowanceParams) Account

func (ImmutableAllowanceParams) Delegation

type ImmutableAllowanceResults

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

func (ImmutableAllowanceResults) Amount

type ImmutableAllowancesForAgent

type ImmutableAllowancesForAgent = MapAgentIDToImmutableInt64

type ImmutableApproveParams

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

func (ImmutableApproveParams) Amount

func (ImmutableApproveParams) Delegation

type ImmutableBalanceOfParams

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

func (ImmutableBalanceOfParams) Account

type ImmutableBalanceOfResults

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

func (ImmutableBalanceOfResults) Amount

type ImmutableErc20State

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

func (ImmutableErc20State) AllAllowances

func (ImmutableErc20State) Balances

func (ImmutableErc20State) Supply

type ImmutableInitParams

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

func (ImmutableInitParams) Creator

func (ImmutableInitParams) Supply

type ImmutableTotalSupplyResults

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

func (ImmutableTotalSupplyResults) Supply

type ImmutableTransferFromParams

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

func (ImmutableTransferFromParams) Account

func (ImmutableTransferFromParams) Amount

func (ImmutableTransferFromParams) Recipient

type ImmutableTransferParams

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

func (ImmutableTransferParams) Account

func (ImmutableTransferParams) Amount

type InitCall

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

type InitContext

type InitContext struct {
	Params ImmutableInitParams
	State  MutableErc20State
}

type MapAgentIDToImmutableAllowancesForAgent

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

func (MapAgentIDToImmutableAllowancesForAgent) GetAllowancesForAgent

type MapAgentIDToImmutableInt64

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

func (MapAgentIDToImmutableInt64) GetInt64

type MapAgentIDToMutableAllowancesForAgent

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

func (MapAgentIDToMutableAllowancesForAgent) Clear

func (MapAgentIDToMutableAllowancesForAgent) GetAllowancesForAgent

type MapAgentIDToMutableInt64

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

func (MapAgentIDToMutableInt64) Clear

func (m MapAgentIDToMutableInt64) Clear()

func (MapAgentIDToMutableInt64) GetInt64

type MutableAllowanceParams

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

func (MutableAllowanceParams) Account

func (MutableAllowanceParams) Delegation

type MutableAllowanceResults

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

func (MutableAllowanceResults) Amount

type MutableAllowancesForAgent

type MutableAllowancesForAgent = MapAgentIDToMutableInt64

type MutableApproveParams

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

func (MutableApproveParams) Amount

func (MutableApproveParams) Delegation

type MutableBalanceOfParams

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

func (MutableBalanceOfParams) Account

type MutableBalanceOfResults

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

func (MutableBalanceOfResults) Amount

type MutableErc20State

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

func (MutableErc20State) AllAllowances

func (MutableErc20State) Balances

func (MutableErc20State) Supply

type MutableInitParams

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

func (MutableInitParams) Creator

func (MutableInitParams) Supply

type MutableTotalSupplyResults

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

func (MutableTotalSupplyResults) Supply

type MutableTransferFromParams

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

func (MutableTransferFromParams) Account

func (MutableTransferFromParams) Amount

func (MutableTransferFromParams) Recipient

type MutableTransferParams

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

func (MutableTransferParams) Account

func (MutableTransferParams) Amount

type TotalSupplyCall

type TotalSupplyCall struct {
	Func    *wasmlib.ScView
	Results ImmutableTotalSupplyResults
}

type TotalSupplyContext

type TotalSupplyContext struct {
	Results MutableTotalSupplyResults
	State   ImmutableErc20State
}

type TransferCall

type TransferCall struct {
	Func   *wasmlib.ScFunc
	Params MutableTransferParams
}

type TransferContext

type TransferContext struct {
	Params ImmutableTransferParams
	State  MutableErc20State
}

type TransferFromCall

type TransferFromCall struct {
	Func   *wasmlib.ScFunc
	Params MutableTransferFromParams
}

type TransferFromContext

type TransferFromContext struct {
	Params ImmutableTransferFromParams
	State  MutableErc20State
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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