Documentation
¶
Index ¶
- Constants
- func OnLoad()
- type AllowanceCall
- type AllowanceContext
- type ApproveCall
- type ApproveContext
- type BalanceOfCall
- type BalanceOfContext
- type Funcs
- func (sc Funcs) Allowance(ctx wasmlib.ScViewCallContext) *AllowanceCall
- func (sc Funcs) Approve(ctx wasmlib.ScFuncCallContext) *ApproveCall
- func (sc Funcs) BalanceOf(ctx wasmlib.ScViewCallContext) *BalanceOfCall
- func (sc Funcs) Init(ctx wasmlib.ScFuncCallContext) *InitCall
- func (sc Funcs) TotalSupply(ctx wasmlib.ScViewCallContext) *TotalSupplyCall
- func (sc Funcs) Transfer(ctx wasmlib.ScFuncCallContext) *TransferCall
- func (sc Funcs) TransferFrom(ctx wasmlib.ScFuncCallContext) *TransferFromCall
- type ImmutableAllowanceParams
- type ImmutableAllowanceResults
- type ImmutableAllowancesForAgent
- type ImmutableApproveParams
- type ImmutableBalanceOfParams
- type ImmutableBalanceOfResults
- type ImmutableErc20State
- type ImmutableInitParams
- type ImmutableTotalSupplyResults
- type ImmutableTransferFromParams
- type ImmutableTransferParams
- type InitCall
- type InitContext
- type MapAgentIDToImmutableAllowancesForAgent
- type MapAgentIDToImmutableInt64
- type MapAgentIDToMutableAllowancesForAgent
- type MapAgentIDToMutableInt64
- type MutableAllowanceParams
- type MutableAllowanceResults
- type MutableAllowancesForAgent
- type MutableApproveParams
- type MutableBalanceOfParams
- type MutableBalanceOfResults
- type MutableErc20State
- type MutableInitParams
- type MutableTotalSupplyResults
- type MutableTransferFromParams
- type MutableTransferParams
- type TotalSupplyCall
- type TotalSupplyContext
- type TransferCall
- type TransferContext
- type TransferFromCall
- type TransferFromContext
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 ¶
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) 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 (s ImmutableAllowanceParams) Account() wasmlib.ScImmutableAgentID
func (ImmutableAllowanceParams) Delegation ¶
func (s ImmutableAllowanceParams) Delegation() wasmlib.ScImmutableAgentID
type ImmutableAllowanceResults ¶
type ImmutableAllowanceResults struct {
// contains filtered or unexported fields
}
func (ImmutableAllowanceResults) Amount ¶
func (s ImmutableAllowanceResults) Amount() wasmlib.ScImmutableInt64
type ImmutableAllowancesForAgent ¶
type ImmutableAllowancesForAgent = MapAgentIDToImmutableInt64
type ImmutableApproveParams ¶
type ImmutableApproveParams struct {
// contains filtered or unexported fields
}
func (ImmutableApproveParams) Amount ¶
func (s ImmutableApproveParams) Amount() wasmlib.ScImmutableInt64
func (ImmutableApproveParams) Delegation ¶
func (s ImmutableApproveParams) Delegation() wasmlib.ScImmutableAgentID
type ImmutableBalanceOfParams ¶
type ImmutableBalanceOfParams struct {
// contains filtered or unexported fields
}
func (ImmutableBalanceOfParams) Account ¶
func (s ImmutableBalanceOfParams) Account() wasmlib.ScImmutableAgentID
type ImmutableBalanceOfResults ¶
type ImmutableBalanceOfResults struct {
// contains filtered or unexported fields
}
func (ImmutableBalanceOfResults) Amount ¶
func (s ImmutableBalanceOfResults) Amount() wasmlib.ScImmutableInt64
type ImmutableErc20State ¶
type ImmutableErc20State struct {
// contains filtered or unexported fields
}
func (ImmutableErc20State) AllAllowances ¶
func (s ImmutableErc20State) AllAllowances() MapAgentIDToImmutableAllowancesForAgent
func (ImmutableErc20State) Balances ¶
func (s ImmutableErc20State) Balances() MapAgentIDToImmutableInt64
func (ImmutableErc20State) Supply ¶
func (s ImmutableErc20State) Supply() wasmlib.ScImmutableInt64
type ImmutableInitParams ¶
type ImmutableInitParams struct {
// contains filtered or unexported fields
}
func (ImmutableInitParams) Creator ¶
func (s ImmutableInitParams) Creator() wasmlib.ScImmutableAgentID
func (ImmutableInitParams) Supply ¶
func (s ImmutableInitParams) Supply() wasmlib.ScImmutableInt64
type ImmutableTotalSupplyResults ¶
type ImmutableTotalSupplyResults struct {
// contains filtered or unexported fields
}
func (ImmutableTotalSupplyResults) Supply ¶
func (s ImmutableTotalSupplyResults) Supply() wasmlib.ScImmutableInt64
type ImmutableTransferFromParams ¶
type ImmutableTransferFromParams struct {
// contains filtered or unexported fields
}
func (ImmutableTransferFromParams) Account ¶
func (s ImmutableTransferFromParams) Account() wasmlib.ScImmutableAgentID
func (ImmutableTransferFromParams) Amount ¶
func (s ImmutableTransferFromParams) Amount() wasmlib.ScImmutableInt64
func (ImmutableTransferFromParams) Recipient ¶
func (s ImmutableTransferFromParams) Recipient() wasmlib.ScImmutableAgentID
type ImmutableTransferParams ¶
type ImmutableTransferParams struct {
// contains filtered or unexported fields
}
func (ImmutableTransferParams) Account ¶
func (s ImmutableTransferParams) Account() wasmlib.ScImmutableAgentID
func (ImmutableTransferParams) Amount ¶
func (s ImmutableTransferParams) Amount() wasmlib.ScImmutableInt64
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 ¶
func (m MapAgentIDToImmutableAllowancesForAgent) GetAllowancesForAgent(key wasmlib.ScAgentID) ImmutableAllowancesForAgent
type MapAgentIDToImmutableInt64 ¶
type MapAgentIDToImmutableInt64 struct {
// contains filtered or unexported fields
}
func (MapAgentIDToImmutableInt64) GetInt64 ¶
func (m MapAgentIDToImmutableInt64) GetInt64(key wasmlib.ScAgentID) wasmlib.ScImmutableInt64
type MapAgentIDToMutableAllowancesForAgent ¶
type MapAgentIDToMutableAllowancesForAgent struct {
// contains filtered or unexported fields
}
func (MapAgentIDToMutableAllowancesForAgent) Clear ¶
func (m MapAgentIDToMutableAllowancesForAgent) Clear()
func (MapAgentIDToMutableAllowancesForAgent) GetAllowancesForAgent ¶
func (m MapAgentIDToMutableAllowancesForAgent) GetAllowancesForAgent(key wasmlib.ScAgentID) MutableAllowancesForAgent
type MapAgentIDToMutableInt64 ¶
type MapAgentIDToMutableInt64 struct {
// contains filtered or unexported fields
}
func (MapAgentIDToMutableInt64) Clear ¶
func (m MapAgentIDToMutableInt64) Clear()
func (MapAgentIDToMutableInt64) GetInt64 ¶
func (m MapAgentIDToMutableInt64) GetInt64(key wasmlib.ScAgentID) wasmlib.ScMutableInt64
type MutableAllowanceParams ¶
type MutableAllowanceParams struct {
// contains filtered or unexported fields
}
func (MutableAllowanceParams) Account ¶
func (s MutableAllowanceParams) Account() wasmlib.ScMutableAgentID
func (MutableAllowanceParams) Delegation ¶
func (s MutableAllowanceParams) Delegation() wasmlib.ScMutableAgentID
type MutableAllowanceResults ¶
type MutableAllowanceResults struct {
// contains filtered or unexported fields
}
func (MutableAllowanceResults) Amount ¶
func (s MutableAllowanceResults) Amount() wasmlib.ScMutableInt64
type MutableAllowancesForAgent ¶
type MutableAllowancesForAgent = MapAgentIDToMutableInt64
type MutableApproveParams ¶
type MutableApproveParams struct {
// contains filtered or unexported fields
}
func (MutableApproveParams) Amount ¶
func (s MutableApproveParams) Amount() wasmlib.ScMutableInt64
func (MutableApproveParams) Delegation ¶
func (s MutableApproveParams) Delegation() wasmlib.ScMutableAgentID
type MutableBalanceOfParams ¶
type MutableBalanceOfParams struct {
// contains filtered or unexported fields
}
func (MutableBalanceOfParams) Account ¶
func (s MutableBalanceOfParams) Account() wasmlib.ScMutableAgentID
type MutableBalanceOfResults ¶
type MutableBalanceOfResults struct {
// contains filtered or unexported fields
}
func (MutableBalanceOfResults) Amount ¶
func (s MutableBalanceOfResults) Amount() wasmlib.ScMutableInt64
type MutableErc20State ¶
type MutableErc20State struct {
// contains filtered or unexported fields
}
func (MutableErc20State) AllAllowances ¶
func (s MutableErc20State) AllAllowances() MapAgentIDToMutableAllowancesForAgent
func (MutableErc20State) Balances ¶
func (s MutableErc20State) Balances() MapAgentIDToMutableInt64
func (MutableErc20State) Supply ¶
func (s MutableErc20State) Supply() wasmlib.ScMutableInt64
type MutableInitParams ¶
type MutableInitParams struct {
// contains filtered or unexported fields
}
func (MutableInitParams) Creator ¶
func (s MutableInitParams) Creator() wasmlib.ScMutableAgentID
func (MutableInitParams) Supply ¶
func (s MutableInitParams) Supply() wasmlib.ScMutableInt64
type MutableTotalSupplyResults ¶
type MutableTotalSupplyResults struct {
// contains filtered or unexported fields
}
func (MutableTotalSupplyResults) Supply ¶
func (s MutableTotalSupplyResults) Supply() wasmlib.ScMutableInt64
type MutableTransferFromParams ¶
type MutableTransferFromParams struct {
// contains filtered or unexported fields
}
func (MutableTransferFromParams) Account ¶
func (s MutableTransferFromParams) Account() wasmlib.ScMutableAgentID
func (MutableTransferFromParams) Amount ¶
func (s MutableTransferFromParams) Amount() wasmlib.ScMutableInt64
func (MutableTransferFromParams) Recipient ¶
func (s MutableTransferFromParams) Recipient() wasmlib.ScMutableAgentID
type MutableTransferParams ¶
type MutableTransferParams struct {
// contains filtered or unexported fields
}
func (MutableTransferParams) Account ¶
func (s MutableTransferParams) Account() wasmlib.ScMutableAgentID
func (MutableTransferParams) Amount ¶
func (s MutableTransferParams) Amount() wasmlib.ScMutableInt64
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
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.