Documentation
¶
Overview ¶
Package isc defines fundamental types that are used in Wasp.
Index ¶
- Constants
- func AddressFromAgentID(a AgentID) (*cryptolib.Address, bool)
- func ArgAt[T any](results CallResults, index int) (r T, _ error)
- func ContractStateSubrealm(chainState kv.KVStore, contract Hname) kv.KVStore
- func ContractStateSubrealmR(chainState kv.KVStoreReader, contract Hname) kv.KVStoreReader
- func DecodeAsset(assets *Assets, cmd *iotago.ProgrammableMoveCall, ...) error
- func DecodeCoin(assets *Assets, cmd *iotago.ProgrammableMoveCall, ...) error
- func DecodeCreateAndSendRequest(msg *EstimationRequest, cmd *iotago.ProgrammableMoveCall, ...) error
- func DecodeDryRunTransaction(dryRunRes *iotajsonrpc.DryRunTransactionBlockResponse) (*Assets, *EstimationRequest, *cryptolib.Address, error)
- func EVMCallDataFromTx(tx *types.Transaction) *ethereum.CallMsg
- func GetErrorIDFromMessageFormat(messageFormat string) uint16
- func IsOffledgerKind(b byte) bool
- func MustArgAt[T any](results CallResults, index int) T
- func MustOptionalArgAt[T any](results CallResults, index int, def T) T
- func MustOptionalResAt[T any](results CallResults, index int, def T) T
- func MustResAt[T any](results CallResults, index int) T
- func OptionalArgAt[T any](results CallResults, index int, def T) (T, error)
- func OptionalResAt[T any](results CallResults, index int, def T) (T, error)
- func RequestGasPrice(req Request) *big.Int
- func RequestHash(req Request) hashing.HashValue
- func ResAt[T any](results CallResults, index int) (T, error)
- func VMErrorIs(err error, expected VMErrorBase) bool
- func VMErrorMustBe(err error, expected VMErrorBase)
- type AddressAgentID
- type AgentID
- type AgentIDKind
- type AgentIDWithL1Address
- type Assets
- func (a *Assets) Add(b *Assets) *Assets
- func (a *Assets) AddBaseTokens(amount coin.Value) *Assets
- func (a *Assets) AddCoin(coinType coin.Type, amount coin.Value) *Assets
- func (a *Assets) AddObject(obj IotaObject) *Assets
- func (a *Assets) AsAssetsBagWithBalances(b *iscmove.AssetsBag) *iscmove.AssetsBagWithBalances
- func (a *Assets) AsISCMove() *iscmove.Assets
- func (a *Assets) BaseTokens() coin.Value
- func (a *Assets) Bytes() []byte
- func (a *Assets) Clone() *Assets
- func (a *Assets) CoinBalance(coinType coin.Type) coin.Value
- func (a *Assets) Equals(b *Assets) bool
- func (a *Assets) IsEmpty() bool
- func (a *Assets) SetBaseTokens(amount coin.Value) *Assets
- func (a *Assets) Size() int
- func (a *Assets) Spend(toSpend *Assets) bool
- func (a *Assets) String() string
- type Authorize
- type BLS
- type Balance
- type CallArguments
- func (c CallArguments) At(index int) ([]byte, error)
- func (c CallArguments) Bytes() []byte
- func (c CallArguments) Clone() CallArguments
- func (c CallArguments) Equals(other CallArguments) bool
- func (c CallArguments) Length() int
- func (c CallArguments) MarshalJSON() ([]byte, error)
- func (c CallArguments) MustAt(index int) []byte
- func (c CallArguments) OrNil(index int) []byte
- func (c CallArguments) String() string
- func (c *CallArguments) UnmarshalJSON(data []byte) error
- type CallResults
- type CallTarget
- type Calldata
- type ChainID
- func ChainIDFromAddress(addr *cryptolib.Address) ChainID
- func ChainIDFromBytes(data []byte) (ret ChainID, err error)
- func ChainIDFromKey(key ChainIDKey) ChainID
- func ChainIDFromObjectID(addr iotago.ObjectID) ChainID
- func ChainIDFromString(hexAddress string) (ChainID, error)
- func EmptyChainID() ChainID
- func (id ChainID) AsAddress() *cryptolib.Address
- func (id ChainID) AsObjectID() iotago.ObjectID
- func (id ChainID) Bytes() []byte
- func (id ChainID) Empty() bool
- func (id ChainID) Equals(other ChainID) bool
- func (id ChainID) Key() ChainIDKey
- func (id ChainID) ShortString() string
- func (id ChainID) String() string
- type ChainIDKey
- type ChainInfo
- type CoinBalances
- func (c CoinBalances) Add(coinType coin.Type, amount coin.Value) CoinBalances
- func (c CoinBalances) AddBaseTokens(amount coin.Value) CoinBalances
- func (c CoinBalances) BaseTokens() coin.Value
- func (c CoinBalances) Bytes() []byte
- func (c CoinBalances) Clone() CoinBalances
- func (c CoinBalances) Equals(b CoinBalances) bool
- func (c CoinBalances) Get(coinType coin.Type) coin.Value
- func (c CoinBalances) IsEmpty() bool
- func (c CoinBalances) Iterate() iter.Seq2[coin.Type, coin.Value]
- func (c CoinBalances) NativeTokens() CoinBalances
- func (c CoinBalances) Set(coinType coin.Type, amount coin.Value) CoinBalances
- func (c CoinBalances) Size() int
- func (c CoinBalances) String() string
- func (c CoinBalances) Sub(coinType coin.Type, amount coin.Value) CoinBalances
- func (c CoinBalances) ToAssets() *Assets
- type ContractAgentID
- func (a *ContractAgentID) Address() *cryptolib.Address
- func (a *ContractAgentID) Bytes() []byte
- func (a *ContractAgentID) BytesWithoutChainID() []byte
- func (a *ContractAgentID) Equals(other AgentID) bool
- func (a *ContractAgentID) Hname() Hname
- func (a *ContractAgentID) Kind() AgentIDKind
- func (a *ContractAgentID) String() string
- type ContractIdentity
- func (c *ContractIdentity) AgentID(chainID ChainID) AgentID
- func (c *ContractIdentity) EVMAddress() (common.Address, error)
- func (c *ContractIdentity) Empty() bool
- func (c *ContractIdentity) Hname() (Hname, error)
- func (c *ContractIdentity) MarshalBCS(e *bcs.Encoder) error
- func (c *ContractIdentity) String() string
- func (c *ContractIdentity) UnmarshalBCS(d *bcs.Decoder) error
- type ControlAddresses
- type CoreCallbackFunc
- type ED25519
- type EstimationRequest
- type EthereumAddressAgentID
- type Event
- type Expiration
- type Gas
- type Hashing
- type Helpers
- type Hname
- type IRC30NativeTokenMetadata
- type ImpersonatedOffLedgerRequest
- type ImpersonatedOffLedgerRequestData
- type IotaObject
- type JSONTokenScheme
- type LogInterface
- type Message
- type NilAgentID
- type ObjectSet
- func (o ObjectSet) Add(obj IotaObject)
- func (o ObjectSet) AddAll(obj []IotaObject)
- func (o ObjectSet) Clone() ObjectSet
- func (o ObjectSet) Equals(b ObjectSet) bool
- func (o ObjectSet) Has(id iotago.ObjectID) bool
- func (o ObjectSet) IsEmpty() bool
- func (o ObjectSet) Iterate() iter.Seq[IotaObject]
- func (o ObjectSet) KeysSorted() []iotago.ObjectID
- func (o ObjectSet) Size() int
- func (o ObjectSet) Sorted() []IotaObject
- type OffLedgerRequest
- type OffLedgerRequestData
- func (req *OffLedgerRequestData) Allowance() (*Assets, error)
- func (req *OffLedgerRequestData) Assets() *Assets
- func (req *OffLedgerRequestData) Bytes() []byte
- func (req *OffLedgerRequestData) ChainID() ChainID
- func (req *OffLedgerRequestData) EVMCallMsg() *ethereum.CallMsg
- func (req *OffLedgerRequestData) Expiry() (time.Time, *cryptolib.Address)
- func (req *OffLedgerRequestData) GasBudget() (gasBudget uint64, isEVM bool)
- func (req *OffLedgerRequestData) GasPrice() *big.Int
- func (req *OffLedgerRequestData) ID() (requestID RequestID)
- func (req *OffLedgerRequestData) IsOffLedger() bool
- func (req *OffLedgerRequestData) Message() Message
- func (req *OffLedgerRequestData) Nonce() uint64
- func (req *OffLedgerRequestData) ReturnAmount() (uint64, bool)
- func (req *OffLedgerRequestData) SenderAccount() AgentID
- func (req *OffLedgerRequestData) String() string
- func (req *OffLedgerRequestData) TimeLock() time.Time
- func (req *OffLedgerRequestData) Timestamp() time.Time
- func (req *OffLedgerRequestData) VerifySignature() error
- type OffLedgerRequestDataEssence
- func (req *OffLedgerRequestDataEssence) Bytes() []byte
- func (req *OffLedgerRequestDataEssence) Sign(signer cryptolib.Signer) OffLedgerRequest
- func (req *OffLedgerRequestDataEssence) WithAllowance(allowance *Assets) UnsignedOffLedgerRequest
- func (req *OffLedgerRequestDataEssence) WithGasBudget(gasBudget uint64) UnsignedOffLedgerRequest
- func (req *OffLedgerRequestDataEssence) WithNonce(nonce uint64) UnsignedOffLedgerRequest
- func (req *OffLedgerRequestDataEssence) WithSender(sender *cryptolib.PublicKey) OffLedgerRequest
- type OnLedgerRequest
- type OnLedgerRequestData
- func (req *OnLedgerRequestData) Allowance() (*Assets, error)
- func (req *OnLedgerRequestData) Assets() *Assets
- func (req *OnLedgerRequestData) AssetsBag() *iscmove.AssetsBagWithBalances
- func (req *OnLedgerRequestData) Bytes() []byte
- func (req *OnLedgerRequestData) EVMCallMsg() *ethereum.CallMsg
- func (req *OnLedgerRequestData) GasBudget() (gasBudget uint64, isEVM bool)
- func (req *OnLedgerRequestData) ID() RequestID
- func (req *OnLedgerRequestData) IsOffLedger() bool
- func (req *OnLedgerRequestData) Message() Message
- func (req *OnLedgerRequestData) RequestID() iotago.ObjectID
- func (req *OnLedgerRequestData) RequestRef() iotago.ObjectRef
- func (req *OnLedgerRequestData) SenderAccount() AgentID
- func (req *OnLedgerRequestData) SenderAddress() *cryptolib.Address
- func (req *OnLedgerRequestData) String() string
- type Privileged
- type ProcessorEntryPoint
- type PublicChainMetadata
- type Receipt
- type Request
- type RequestID
- func (rid *RequestID) AsIotaAddress() iotago.Address
- func (rid *RequestID) AsIotaObjectID() iotago.ObjectID
- func (rid RequestID) Bytes() []byte
- func (rid RequestID) Equals(other RequestID) bool
- func (rid RequestID) LookupDigest() RequestLookupDigest
- func (rid RequestID) Short() string
- func (rid RequestID) String() string
- type RequestKind
- type RequestLookupDigest
- type RequestMetadata
- type RequestParameters
- type RequestRef
- type RequestRefKey
- type Sandbox
- type SandboxBase
- type SandboxView
- type SchemaVersion
- type SendMetadata
- type SendOptions
- type SimpleTokenScheme
- type StateAnchor
- func (s StateAnchor) Anchor() *iscmove.AnchorWithRef
- func (s StateAnchor) ChainID() ChainID
- func (s StateAnchor) Equals(input *StateAnchor) bool
- func (s StateAnchor) GetAssetsBag() *iscmove.AssetsBag
- func (s StateAnchor) GetObjectID() *iotago.ObjectID
- func (s StateAnchor) GetObjectRef() *iotago.ObjectRef
- func (s StateAnchor) GetStateIndex() uint32
- func (s StateAnchor) GetStateMetadata() []byte
- func (s StateAnchor) Hash() hashing.HashValue
- func (s *StateAnchor) ISCPackage() iotago.Address
- func (s *StateAnchor) MarshalBCS(e *bcs.Encoder) error
- func (s StateAnchor) Owner() *cryptolib.Address
- func (s StateAnchor) String() string
- func (s *StateAnchor) UnmarshalBCS(d *bcs.Decoder) error
- type UnresolvedVMError
- type UnsignedOffLedgerRequest
- type Utils
- type VMError
- func (e *VMError) AsGoError() error
- func (e *VMError) AsTemplate() *VMErrorTemplate
- func (e *VMError) AsUnresolvedError() *UnresolvedVMError
- func (e *VMError) Bytes() []byte
- func (e *VMError) Code() VMErrorCode
- func (e *VMError) Error() string
- func (e *VMError) MessageFormat() string
- func (e *VMError) Params() []VMErrorParam
- type VMErrorBase
- type VMErrorCode
- type VMErrorParam
- type VMErrorTemplate
- type VMProcessor
- type VMProcessorEntryPoint
Constants ¶
const ChainIDLength = iotago.AddressLen
const GasCoinTargetValue = iotaclient.DefaultGasBudget * 5
GasCoinTargetValue is the target value for topping up the gas coin. After each VM run, the gas coin will be topped up taking funds from the common account.
const HnameLength = 4
const HnameNil = Hname(0)
HnameNil is the value used to represent a non-existent Hname.
const (
Million = 1_000_000
)
const RequestIDDigestLen = 6
const RequestRefKeyLen = iotago.AddressLen + 32
const VMCoreErrorContractID = math.MaxUint32
VMCoreErrorContractID defines that all errors with a MaxUint32 contract id will be considered as core errors.
const VMErrorMessageLimit = math.MaxUint16
Variables ¶
This section is empty.
Functions ¶
func AddressFromAgentID ¶
AddressFromAgentID returns the L1 address of the AgentID, if applicable.
func ContractStateSubrealm ¶
func ContractStateSubrealmR ¶
func ContractStateSubrealmR(chainState kv.KVStoreReader, contract Hname) kv.KVStoreReader
func DecodeAsset ¶
func DecodeAsset(assets *Assets, cmd *iotago.ProgrammableMoveCall, inputs []iotajsonrpc.ProgrammableTransactionBlockPureInput) error
func DecodeCoin ¶
func DecodeCoin(assets *Assets, cmd *iotago.ProgrammableMoveCall, inputs []iotajsonrpc.ProgrammableTransactionBlockPureInput) error
func DecodeCreateAndSendRequest ¶
func DecodeCreateAndSendRequest(msg *EstimationRequest, cmd *iotago.ProgrammableMoveCall, inputs []iotajsonrpc.ProgrammableTransactionBlockPureInput) error
func DecodeDryRunTransaction ¶
func DecodeDryRunTransaction(dryRunRes *iotajsonrpc.DryRunTransactionBlockResponse) (*Assets, *EstimationRequest, *cryptolib.Address, error)
DecodeDryRunTransaction The intention of this parser is to make the use of the gas estimation easier. We only accept the transactionBytes and select all needed inputs. The upside is that a user can pass an unsigned transaction to estimate. The downside is that any time we change create_and_send_request in the move contract, we need to update this logic. I don't expect it to change often if ever, so that seems to be a straight forward way.
func EVMCallDataFromTx ¶
func EVMCallDataFromTx(tx *types.Transaction) *ethereum.CallMsg
func IsOffledgerKind ¶
func MustArgAt ¶
func MustArgAt[T any](results CallResults, index int) T
func MustOptionalArgAt ¶
func MustOptionalArgAt[T any](results CallResults, index int, def T) T
func MustOptionalResAt ¶
func MustOptionalResAt[T any](results CallResults, index int, def T) T
func MustResAt ¶
func MustResAt[T any](results CallResults, index int) T
func OptionalArgAt ¶
func OptionalArgAt[T any](results CallResults, index int, def T) (T, error)
func OptionalResAt ¶
func OptionalResAt[T any](results CallResults, index int, def T) (T, error)
func RequestGasPrice ¶
RequestGasPrice returns: for ISC request: nil, for EVM tx: the gas price set in the EVM tx (full decimals), or 0 if gas price is unset
func RequestHash ¶
func VMErrorIs ¶
func VMErrorIs(err error, expected VMErrorBase) bool
VMErrorIs returns true if the error includes a VMErrorCode in its chain that matches the given code
func VMErrorMustBe ¶
func VMErrorMustBe(err error, expected VMErrorBase)
VMErrorMustBe panics unless the error includes a VMErrorCode in its chain that matches the given code
Types ¶
type AddressAgentID ¶
type AddressAgentID struct {
// contains filtered or unexported fields
}
AddressAgentID is an AgentID backed by a L1 address
func NewAddressAgentID ¶
func NewAddressAgentID(addr *cryptolib.Address) *AddressAgentID
func (*AddressAgentID) Address ¶
func (a *AddressAgentID) Address() *cryptolib.Address
func (*AddressAgentID) Bytes ¶
func (a *AddressAgentID) Bytes() []byte
func (*AddressAgentID) Equals ¶
func (a *AddressAgentID) Equals(other AgentID) bool
func (*AddressAgentID) Kind ¶
func (a *AddressAgentID) Kind() AgentIDKind
func (*AddressAgentID) String ¶
func (a *AddressAgentID) String() string
type AgentID ¶
type AgentID interface {
Bytes() []byte
Equals(other AgentID) bool
Kind() AgentIDKind
String() string
}
AgentID represents any entity that can hold assets on L2 and/or call contracts.
func AgentIDFromBytes ¶
func AgentIDFromString ¶
AgentIDFromString parses the human-readable string representation
type AgentIDKind ¶
type AgentIDKind byte
const ( AgentIDKindNil AgentIDKind = iota AgentIDKindAddress AgentIDKindContract AgentIDKindEthereumAddress AgentIDIsNil AgentIDKind = 0x80 )
type AgentIDWithL1Address ¶
AgentIDWithL1Address is an AgentID backed by an L1 address (either AddressAgentID or ContractAgentID).
type Assets ¶
type Assets struct {
// Coins is a set of coin balances
Coins CoinBalances `json:"coins" swagger:"required"`
// Objects is a set of non-Coin object IDs (e.g. NFTs)
Objects ObjectSet `json:"objects" swagger:"required"`
}
func AssetsFromAssetsBagWithBalances ¶
func AssetsFromAssetsBagWithBalances(assetsBag *iscmove.AssetsBagWithBalances) (*Assets, error)
func AssetsFromBytes ¶
func NewEmptyAssets ¶
func NewEmptyAssets() *Assets
func (*Assets) AddObject ¶
func (a *Assets) AddObject(obj IotaObject) *Assets
func (*Assets) AsAssetsBagWithBalances ¶
func (a *Assets) AsAssetsBagWithBalances(b *iscmove.AssetsBag) *iscmove.AssetsBagWithBalances
func (*Assets) BaseTokens ¶
type Balance ¶
type Balance interface {
// BalanceBaseTokens returns number of base tokens in the balance of the smart contract
BaseTokensBalance() (bts coin.Value, remainder *big.Int)
// CoinBalance returns the balance of the given coin
CoinBalance(p coin.Type) coin.Value
// CoinBalances returns the balance of all coins owned by the smart contract
CoinBalances() CoinBalances
// OwnedObjects returns the ids of objects owned by the smart contract
OwnedObjects() []IotaObject
// returns whether a given user owns a given amount of tokens
HasInAccount(AgentID, *Assets) bool
}
type CallArguments ¶
type CallArguments [][]byte
func CallArgumentsFromBytes ¶
func CallArgumentsFromBytes(b []byte) (CallArguments, error)
func NewCallArguments ¶
func NewCallArguments(args ...[]byte) CallArguments
func (CallArguments) Bytes ¶
func (c CallArguments) Bytes() []byte
func (CallArguments) Clone ¶
func (c CallArguments) Clone() CallArguments
func (CallArguments) Equals ¶
func (c CallArguments) Equals(other CallArguments) bool
func (CallArguments) Length ¶
func (c CallArguments) Length() int
func (CallArguments) MarshalJSON ¶
func (c CallArguments) MarshalJSON() ([]byte, error)
func (CallArguments) MustAt ¶
func (c CallArguments) MustAt(index int) []byte
func (CallArguments) OrNil ¶
func (c CallArguments) OrNil(index int) []byte
func (CallArguments) String ¶
func (c CallArguments) String() string
func (*CallArguments) UnmarshalJSON ¶
func (c *CallArguments) UnmarshalJSON(data []byte) error
type CallResults ¶
type CallResults = CallArguments
type CallTarget ¶
CallTarget the target representation of the request
func NewCallTarget ¶
func NewCallTarget(contract, entryPoint Hname) CallTarget
func (CallTarget) Equals ¶
func (t CallTarget) Equals(otherTarget CallTarget) bool
type Calldata ¶
type Calldata interface {
// Assets returns the attached assets for the on-ledger request, empty for off-ledger.
// Attached assets are deposited in the sender's L2 account by default.
Assets() *Assets
// Allowance returns the assets that the sender allows to be debited
// from their L2 account and transferred to the target contract
// Returns error if there was an error decoding the allowance from the on-ledger request.
Allowance() (*Assets, error)
Message() Message
GasBudget() (gas uint64, isEVM bool)
ID() RequestID
SenderAccount() AgentID
EVMCallMsg() *ethereum.CallMsg
}
type ChainID ¶
ChainID is the anchor ObjectID
func ChainIDFromAddress ¶
func ChainIDFromBytes ¶
ChainIDFromBytes reconstructs a ChainID from its binary representation.
func ChainIDFromKey ¶
func ChainIDFromKey(key ChainIDKey) ChainID
func ChainIDFromObjectID ¶
func ChainIDFromString ¶
func (ChainID) AsObjectID ¶
func (ChainID) Key ¶
func (id ChainID) Key() ChainIDKey
func (ChainID) ShortString ¶
type ChainIDKey ¶
type ChainIDKey string
ChainID represents the global identifier of the chain It is wrapped AliasAddress, an address without a private key behind
type ChainInfo ¶
type ChainInfo struct {
ChainID ChainID
ChainAdmin AgentID
GasFeePolicy *gas.FeePolicy
GasLimits *gas.Limits
BlockKeepAmount int32
PublicURL string
Metadata *PublicChainMetadata
}
ChainInfo is an API structure containing the main parameters of the chain
func ChainInfoFromBytes ¶
type CoinBalances ¶
type CoinBalances struct {
// contains filtered or unexported fields
}
func CoinBalancesFromBytes ¶
func CoinBalancesFromBytes(b []byte) (CoinBalances, error)
func NewCoinBalances ¶
func NewCoinBalances() CoinBalances
func (CoinBalances) Add ¶
func (c CoinBalances) Add(coinType coin.Type, amount coin.Value) CoinBalances
func (CoinBalances) AddBaseTokens ¶
func (c CoinBalances) AddBaseTokens(amount coin.Value) CoinBalances
func (CoinBalances) BaseTokens ¶
func (c CoinBalances) BaseTokens() coin.Value
func (CoinBalances) Bytes ¶
func (c CoinBalances) Bytes() []byte
func (CoinBalances) Clone ¶
func (c CoinBalances) Clone() CoinBalances
func (CoinBalances) Equals ¶
func (c CoinBalances) Equals(b CoinBalances) bool
func (CoinBalances) IsEmpty ¶
func (c CoinBalances) IsEmpty() bool
func (CoinBalances) NativeTokens ¶
func (c CoinBalances) NativeTokens() CoinBalances
func (CoinBalances) Set ¶
func (c CoinBalances) Set(coinType coin.Type, amount coin.Value) CoinBalances
func (CoinBalances) Size ¶
func (c CoinBalances) Size() int
func (CoinBalances) String ¶
func (c CoinBalances) String() string
func (CoinBalances) Sub ¶
func (c CoinBalances) Sub(coinType coin.Type, amount coin.Value) CoinBalances
func (CoinBalances) ToAssets ¶
func (c CoinBalances) ToAssets() *Assets
type ContractAgentID ¶
type ContractAgentID struct {
// contains filtered or unexported fields
}
ContractAgentID is an AgentID formed by a contract Hname.
func NewContractAgentID ¶
func NewContractAgentID(hname Hname) *ContractAgentID
func (*ContractAgentID) Address ¶
func (a *ContractAgentID) Address() *cryptolib.Address
func (*ContractAgentID) Bytes ¶
func (a *ContractAgentID) Bytes() []byte
func (*ContractAgentID) BytesWithoutChainID ¶
func (a *ContractAgentID) BytesWithoutChainID() []byte
func (*ContractAgentID) Equals ¶
func (a *ContractAgentID) Equals(other AgentID) bool
func (*ContractAgentID) Hname ¶
func (a *ContractAgentID) Hname() Hname
func (*ContractAgentID) Kind ¶
func (a *ContractAgentID) Kind() AgentIDKind
func (*ContractAgentID) String ¶
func (a *ContractAgentID) String() string
type ContractIdentity ¶
type ContractIdentity struct {
// contains filtered or unexported fields
}
func ContractIdentityFromEVMAddress ¶
func ContractIdentityFromEVMAddress(addr common.Address) ContractIdentity
func ContractIdentityFromHname ¶
func ContractIdentityFromHname(hn Hname) ContractIdentity
func EmptyContractIdentity ¶
func EmptyContractIdentity() ContractIdentity
func (*ContractIdentity) AgentID ¶
func (c *ContractIdentity) AgentID(chainID ChainID) AgentID
func (*ContractIdentity) EVMAddress ¶
func (c *ContractIdentity) EVMAddress() (common.Address, error)
func (*ContractIdentity) Empty ¶
func (c *ContractIdentity) Empty() bool
func (*ContractIdentity) Hname ¶
func (c *ContractIdentity) Hname() (Hname, error)
func (*ContractIdentity) MarshalBCS ¶
func (c *ContractIdentity) MarshalBCS(e *bcs.Encoder) error
func (*ContractIdentity) String ¶
func (c *ContractIdentity) String() string
func (*ContractIdentity) UnmarshalBCS ¶
func (c *ContractIdentity) UnmarshalBCS(d *bcs.Decoder) error
type ControlAddresses ¶
type CoreCallbackFunc ¶
type EstimationRequest ¶
type EthereumAddressAgentID ¶
type EthereumAddressAgentID struct {
// contains filtered or unexported fields
}
EthereumAddressAgentID is an AgentID formed by an Ethereum address
func NewEthereumAddressAgentID ¶
func NewEthereumAddressAgentID(eth common.Address) *EthereumAddressAgentID
func (*EthereumAddressAgentID) Bytes ¶
func (a *EthereumAddressAgentID) Bytes() []byte
func (*EthereumAddressAgentID) Equals ¶
func (a *EthereumAddressAgentID) Equals(other AgentID) bool
func (*EthereumAddressAgentID) EthAddress ¶
func (a *EthereumAddressAgentID) EthAddress() common.Address
func (*EthereumAddressAgentID) Kind ¶
func (a *EthereumAddressAgentID) Kind() AgentIDKind
func (*EthereumAddressAgentID) String ¶
func (a *EthereumAddressAgentID) String() string
type Event ¶
type Event struct {
ContractID Hname `json:"contractID"`
Topic string `json:"topic"`
Timestamp uint64 `json:"timestamp"`
Payload []byte `json:"payload"`
}
func EventFromBytes ¶
type Hname ¶
type Hname uint32
Hname is calculated as the first 4 bytes of the BLAKE2b hash of a string, interpreted as a little-endian uint32.
func ContractIDFromEventBytes ¶
ContractIDFromEventBytes is used by blocklog to filter out specific events per contract For performance reasons it is working directly with the event bytes.
func Hn ¶
Hn calculates the hname for the given string. For any given string s, it is guaranteed that Hn(s) != HnameNil.
func HnameFromAgentID ¶
HnameFromAgentID returns the hname of the AgentID, or HnameNil if not applicable.
func HnameFromBytes ¶
func HnameFromString ¶
type IRC30NativeTokenMetadata ¶
type IRC30NativeTokenMetadata struct {
Standard string `json:"standard"`
Name string `json:"name"`
Symbol string `json:"symbol"`
Decimals uint8 `json:"decimals"`
}
IRC30NativeTokenMetadata represents the Native Token metadata according to IRC30. See: https://github.com/iotaledger/tips/blob/main/tips/TIP-0030/tip-0030.md Right now, only required properties are included. Optional parameters such as description or logo/Url can be added later
func IRC30NativeTokenMetadataFromBytes ¶
func IRC30NativeTokenMetadataFromBytes(b []byte) (*IRC30NativeTokenMetadata, error)
func NewIRC30NativeTokenMetadata ¶
func NewIRC30NativeTokenMetadata(name, symbol string, decimals uint8) *IRC30NativeTokenMetadata
func (*IRC30NativeTokenMetadata) Bytes ¶
func (m *IRC30NativeTokenMetadata) Bytes() []byte
type ImpersonatedOffLedgerRequest ¶
type ImpersonatedOffLedgerRequest interface {
WithSenderAddress(senderAddress *cryptolib.Address) OffLedgerRequest
}
func NewImpersonatedOffLedgerRequest ¶
func NewImpersonatedOffLedgerRequest(request *OffLedgerRequestDataEssence) ImpersonatedOffLedgerRequest
type ImpersonatedOffLedgerRequestData ¶
type ImpersonatedOffLedgerRequestData struct {
OffLedgerRequestData
// contains filtered or unexported fields
}
func (*ImpersonatedOffLedgerRequestData) SenderAccount ¶
func (r *ImpersonatedOffLedgerRequestData) SenderAccount() AgentID
func (*ImpersonatedOffLedgerRequestData) WithSenderAddress ¶
func (r *ImpersonatedOffLedgerRequestData) WithSenderAddress(senderAddress *cryptolib.Address) OffLedgerRequest
type IotaObject ¶
type IotaObject struct {
ID iotago.ObjectID
Type iotago.ObjectType
}
IotaObject represents a non-coin object originally created on L1
func NewIotaObject ¶
func NewIotaObject(id iotago.ObjectID, t iotago.ObjectType) IotaObject
type JSONTokenScheme ¶
type JSONTokenScheme struct {
Type int `json:"type"`
MintedSupply string `json:"mintedTokens"`
MeltedTokens string `json:"meltedTokens"`
MaximumSupply string `json:"maximumSupply"`
}
JSONTokenScheme is for now a 1:1 copy of the Stardusts version
type LogInterface ¶
type Message ¶
type Message struct {
Target CallTarget `json:"target"`
Params CallArguments `json:"params"`
}
func NewMessage ¶
func NewMessage(contract Hname, ep Hname, params ...CallArguments) Message
func NewMessageFromNames ¶
func NewMessageFromNames(contract string, ep string, params ...CallArguments) Message
type NilAgentID ¶
type NilAgentID struct{}
func (*NilAgentID) Bytes ¶
func (a *NilAgentID) Bytes() []byte
func (*NilAgentID) Equals ¶
func (a *NilAgentID) Equals(other AgentID) bool
func (*NilAgentID) Kind ¶
func (a *NilAgentID) Kind() AgentIDKind
func (*NilAgentID) String ¶
func (a *NilAgentID) String() string
type ObjectSet ¶
type ObjectSet struct {
// contains filtered or unexported fields
}
func NewObjectSet ¶
func NewObjectSet(objs ...IotaObject) ObjectSet
func (ObjectSet) Add ¶
func (o ObjectSet) Add(obj IotaObject)
func (ObjectSet) AddAll ¶
func (o ObjectSet) AddAll(obj []IotaObject)
func (ObjectSet) Iterate ¶
func (o ObjectSet) Iterate() iter.Seq[IotaObject]
Iterate returns a deterministic iterator
func (ObjectSet) KeysSorted ¶
func (ObjectSet) Sorted ¶
func (o ObjectSet) Sorted() []IotaObject
type OffLedgerRequest ¶
type OffLedgerRequest interface {
Request
ChainID() ChainID
Nonce() uint64
VerifySignature() error
GasPrice() *big.Int
}
func NewEVMOffLedgerCallRequest ¶
func NewEVMOffLedgerCallRequest(chainID ChainID, callMsg ethereum.CallMsg) OffLedgerRequest
func NewEVMOffLedgerTxRequest ¶
func NewEVMOffLedgerTxRequest(chainID ChainID, tx *types.Transaction) (OffLedgerRequest, error)
type OffLedgerRequestData ¶
type OffLedgerRequestData struct {
OffLedgerRequestDataEssence
// contains filtered or unexported fields
}
OffLedgerRequestData implements OffLedgerRequest
func (*OffLedgerRequestData) Allowance ¶
func (req *OffLedgerRequestData) Allowance() (*Assets, error)
Allowance from the sender's account to the target smart contract. Nil mean no Allowance
func (*OffLedgerRequestData) Assets ¶
func (req *OffLedgerRequestData) Assets() *Assets
Assets is attached assets to the UTXO. Nil for off-ledger
func (*OffLedgerRequestData) Bytes ¶
func (req *OffLedgerRequestData) Bytes() []byte
func (*OffLedgerRequestData) ChainID ¶
func (req *OffLedgerRequestData) ChainID() ChainID
func (*OffLedgerRequestData) EVMCallMsg ¶
func (req *OffLedgerRequestData) EVMCallMsg() *ethereum.CallMsg
func (*OffLedgerRequestData) Expiry ¶
func (req *OffLedgerRequestData) Expiry() (time.Time, *cryptolib.Address)
func (*OffLedgerRequestData) GasBudget ¶
func (req *OffLedgerRequestData) GasBudget() (gasBudget uint64, isEVM bool)
func (*OffLedgerRequestData) GasPrice ¶
func (req *OffLedgerRequestData) GasPrice() *big.Int
func (*OffLedgerRequestData) ID ¶
func (req *OffLedgerRequestData) ID() (requestID RequestID)
ID returns request id for this request index part of request id is always 0 for off ledger requests note that request needs to have been signed before this value is considered valid
func (*OffLedgerRequestData) IsOffLedger ¶
func (req *OffLedgerRequestData) IsOffLedger() bool
func (*OffLedgerRequestData) Message ¶
func (req *OffLedgerRequestData) Message() Message
func (*OffLedgerRequestData) Nonce ¶
func (req *OffLedgerRequestData) Nonce() uint64
Nonce incremental nonce used for replay protection
func (*OffLedgerRequestData) ReturnAmount ¶
func (req *OffLedgerRequestData) ReturnAmount() (uint64, bool)
func (*OffLedgerRequestData) SenderAccount ¶
func (req *OffLedgerRequestData) SenderAccount() AgentID
func (*OffLedgerRequestData) String ¶
func (req *OffLedgerRequestData) String() string
func (*OffLedgerRequestData) TimeLock ¶
func (req *OffLedgerRequestData) TimeLock() time.Time
func (*OffLedgerRequestData) Timestamp ¶
func (req *OffLedgerRequestData) Timestamp() time.Time
func (*OffLedgerRequestData) VerifySignature ¶
func (req *OffLedgerRequestData) VerifySignature() error
VerifySignature verifies essence signature
type OffLedgerRequestDataEssence ¶
type OffLedgerRequestDataEssence struct {
// contains filtered or unexported fields
}
OffLedgerRequestDataEssence implements UnsignedOffLedgerRequest
func (*OffLedgerRequestDataEssence) Bytes ¶
func (req *OffLedgerRequestDataEssence) Bytes() []byte
func (*OffLedgerRequestDataEssence) Sign ¶
func (req *OffLedgerRequestDataEssence) Sign(signer cryptolib.Signer) OffLedgerRequest
func (*OffLedgerRequestDataEssence) WithAllowance ¶
func (req *OffLedgerRequestDataEssence) WithAllowance(allowance *Assets) UnsignedOffLedgerRequest
func (*OffLedgerRequestDataEssence) WithGasBudget ¶
func (req *OffLedgerRequestDataEssence) WithGasBudget(gasBudget uint64) UnsignedOffLedgerRequest
func (*OffLedgerRequestDataEssence) WithNonce ¶
func (req *OffLedgerRequestDataEssence) WithNonce(nonce uint64) UnsignedOffLedgerRequest
func (*OffLedgerRequestDataEssence) WithSender ¶
func (req *OffLedgerRequestDataEssence) WithSender(sender *cryptolib.PublicKey) OffLedgerRequest
WithSender can be used to estimate gas, without a signature
type OnLedgerRequest ¶
type OnLedgerRequest interface {
Request
RequestRef() iotago.ObjectRef
AssetsBag() *iscmove.AssetsBagWithBalances
}
func OnLedgerFromMoveRequest ¶
func OnLedgerFromMoveRequest(request *iscmove.RefWithObject[iscmove.Request], anchorAddress *cryptolib.Address) (OnLedgerRequest, error)
func ReconstructOnLedgerRequest ¶
func ReconstructOnLedgerRequest(dryRunRes *iotajsonrpc.DryRunTransactionBlockResponse) (OnLedgerRequest, error)
type OnLedgerRequestData ¶
type OnLedgerRequestData struct {
// contains filtered or unexported fields
}
func (*OnLedgerRequestData) Allowance ¶
func (req *OnLedgerRequestData) Allowance() (*Assets, error)
func (*OnLedgerRequestData) Assets ¶
func (req *OnLedgerRequestData) Assets() *Assets
func (*OnLedgerRequestData) AssetsBag ¶
func (req *OnLedgerRequestData) AssetsBag() *iscmove.AssetsBagWithBalances
func (*OnLedgerRequestData) Bytes ¶
func (req *OnLedgerRequestData) Bytes() []byte
func (*OnLedgerRequestData) EVMCallMsg ¶
func (req *OnLedgerRequestData) EVMCallMsg() *ethereum.CallMsg
func (*OnLedgerRequestData) GasBudget ¶
func (req *OnLedgerRequestData) GasBudget() (gasBudget uint64, isEVM bool)
func (*OnLedgerRequestData) ID ¶
func (req *OnLedgerRequestData) ID() RequestID
func (*OnLedgerRequestData) IsOffLedger ¶
func (req *OnLedgerRequestData) IsOffLedger() bool
func (*OnLedgerRequestData) Message ¶
func (req *OnLedgerRequestData) Message() Message
func (*OnLedgerRequestData) RequestID ¶
func (req *OnLedgerRequestData) RequestID() iotago.ObjectID
func (*OnLedgerRequestData) RequestRef ¶
func (req *OnLedgerRequestData) RequestRef() iotago.ObjectRef
func (*OnLedgerRequestData) SenderAccount ¶
func (req *OnLedgerRequestData) SenderAccount() AgentID
func (*OnLedgerRequestData) SenderAddress ¶
func (req *OnLedgerRequestData) SenderAddress() *cryptolib.Address
func (*OnLedgerRequestData) String ¶
func (req *OnLedgerRequestData) String() string
type Privileged ¶
type Privileged interface {
GasBurnEnable(enable bool)
GasBurnEnabled() bool
OnWriteReceipt(CoreCallbackFunc)
CallOnBehalfOf(caller AgentID, msg Message, allowance *Assets) CallArguments
SendOnBehalfOf(caller ContractIdentity, metadata RequestParameters)
// only called from EVM
MustMoveBetweenAccounts(fromAgentID, toAgentID AgentID, assets *Assets)
DebitFromAccount(AgentID, *big.Int)
CreditToAccount(AgentID, *big.Int)
}
Privileged is a sub-interface for core contracts. Should not be called by VM plugins
type ProcessorEntryPoint ¶
type ProcessorEntryPoint interface {
VMProcessorEntryPoint
Name() string
Hname() Hname
}
type PublicChainMetadata ¶
type PublicChainMetadata struct {
EVMJsonRPCURL string
EVMWebSocketURL string
Name string
Description string
Website string
}
func PublicChainMetadataFromBytes ¶
func PublicChainMetadataFromBytes(data []byte) (*PublicChainMetadata, error)
func (*PublicChainMetadata) Bytes ¶
func (m *PublicChainMetadata) Bytes() []byte
type Receipt ¶
type Receipt struct {
Request []byte `json:"request"`
Error *UnresolvedVMError `json:"error"`
GasBudget uint64 `json:"gasBudget"`
GasBurned uint64 `json:"gasBurned"`
GasFeeCharged coin.Value `json:"gasFeeCharged"`
SDCharged coin.Value `json:"storageDepositCharged"`
BlockIndex uint32 `json:"blockIndex"`
RequestIndex uint16 `json:"requestIndex"`
ResolvedError string `json:"resolvedError"`
GasBurnLog *gas.BurnLog `json:"-"`
}
Receipt represents a blocklog.RequestReceipt with a resolved error string
func (Receipt) DeserializedRequest ¶
type Request ¶
Request wraps any data which can be potentially be interpreted as a request
func RequestFromBytes ¶
type RequestID ¶
func RequestIDFromBytes ¶
func RequestIDFromEVMTxHash ¶
func RequestIDFromString ¶
func (*RequestID) AsIotaAddress ¶
func (*RequestID) AsIotaObjectID ¶
func (RequestID) LookupDigest ¶
func (rid RequestID) LookupDigest() RequestLookupDigest
type RequestKind ¶
type RequestKind byte
type RequestLookupDigest ¶
type RequestLookupDigest [RequestIDDigestLen + 2]byte
RequestLookupDigest is shortened version of the request id. It is guaranteed to be unique within one block, however it may collide globally. Used for quick checking for most requests if it was never seen
type RequestMetadata ¶
type RequestMetadata struct {
SenderContract ContractIdentity `json:"senderContract"`
Message Message `json:"message"`
// AllowanceBCS is either empty or a BCS-encoded iscmove.Allowance.
AllowanceBCS []byte `json:"allowanceBcs"`
// gas budget
GasBudget uint64 `json:"gasBudget"`
}
func RequestMetadataFromBytes ¶
func RequestMetadataFromBytes(data []byte) (*RequestMetadata, error)
func (*RequestMetadata) Bytes ¶
func (meta *RequestMetadata) Bytes() []byte
type RequestParameters ¶
type RequestParameters struct {
// TargetAddress is the target address. It may represent another chain or L1 address
TargetAddress *cryptolib.Address
// Assets attached to the request, always taken from the caller's account.
// It expected to contain base tokens at least the amount required for storage deposit
// It depends on the context how it is handled when base tokens are not enough for storage deposit
Assets *Assets
}
RequestParameters represents parameters of the on-ledger request. The request is build from these parameters
type RequestRef ¶
func RequestRefFromBytes ¶
func RequestRefFromBytes(data []byte) (*RequestRef, error)
func RequestRefFromRequest ¶
func RequestRefFromRequest(req Request) *RequestRef
func RequestRefsFromRequests ¶
func RequestRefsFromRequests(reqs []Request) []*RequestRef
func (*RequestRef) AsKey ¶
func (ref *RequestRef) AsKey() RequestRefKey
func (*RequestRef) Bytes ¶
func (ref *RequestRef) Bytes() []byte
func (*RequestRef) IsFor ¶
func (ref *RequestRef) IsFor(req Request) bool
func (*RequestRef) String ¶
func (ref *RequestRef) String() string
type RequestRefKey ¶
type RequestRefKey [RequestRefKeyLen]byte
func (RequestRefKey) String ¶
func (rrk RequestRefKey) String() string
type Sandbox ¶
type Sandbox interface {
SandboxBase
Authorize
// State k/v store of the current call (in the context of the smart contract)
State() kv.KVStore
// Request return the request in the context of which the smart contract is called
Request() Calldata
// Call calls the entry point of the contract with parameters and allowance.
// If the entry point is full entry point, allowance tokens are available to be moved from the caller's
// accounts (if enough). If the entry point is view, 'allowance' has no effect
Call(msg Message, allowance *Assets) CallArguments
// Event emits an event
Event(topic string, payload []byte)
// RegisterError registers an error
RegisterError(messageFormat string) *VMErrorTemplate
// GetEntropy 32 random bytes based on the hash of the current state transaction
GetEntropy() hashing.HashValue
// AllowanceAvailable specifies max remaining (after transfers) budget of assets the smart contract can take
// from the caller with TransferAllowedFunds. Nil means no allowance left (zero budget)
AllowanceAvailable() *Assets
// TransferAllowedFunds moves assets from the caller's account to specified account within the budget set by Allowance.
// Skipping 'assets' means transfer all Allowance().
// The TransferAllowedFunds call mutates AllowanceAvailable
// Returns remaining budget
TransferAllowedFunds(target AgentID, transfer ...*Assets) *Assets
// Send sends an on-ledger request (or a regular transaction to any L1 Address)
Send(metadata RequestParameters)
// StateIndex returns the index of the current block being produced
StateIndex() uint32
// RequestIndex returns the index of the current request in the request batch
RequestIndex() uint16
// EVMTracer returns a non-nil tracer if an EVM tx is being traced
// (e.g. with the debug_traceTransaction JSONRPC method).
EVMTracer() *tracers.Tracer
// TakeStateSnapshot takes a snapshot of the state. This is useful to implement the try/catch
// behavior in Solidity, where the state is reverted after a low level call fails.
TakeStateSnapshot() int
RevertToStateSnapshot(int)
// Privileged is a sub-interface of the sandbox which should not be called by VM plugins
Privileged() Privileged
}
Sandbox is an interface given to the processor to access the VMContext and virtual state, transaction builder and request parameters through it.
type SandboxBase ¶
type SandboxBase interface {
Helpers
Balance
// Params returns the parameters of the current call
Params() CallArguments
// ChainID returns the chain ID
ChainID() ChainID
// ChainAdmin returns the chain admin AgentID (not necessarily the same as "anchor owner")
ChainAdmin() AgentID
// ChainInfo returns information and configuration parameters of the chain
ChainInfo() *ChainInfo
// Contract returns the Hname of the current contract in the context
Contract() Hname
// AccountID returns the agentID of the current contract (i.e. chainID + contract hname)
AccountID() AgentID
// Caller is the agentID of the caller.
Caller() AgentID
// Timestamp returns the Unix timestamp of the current state in seconds
Timestamp() time.Time
// Log returns a logger that outputs on the local machine. It includes Panicf method
Log() LogInterface
// Utils provides access to common necessary functionality
Utils() Utils
// Gas returns sub-interface for gas related functions. It is stateful but does not modify chain's state
Gas() Gas
// GetCoinInfo returns information about a coin known by the chain
GetCoinInfo(coinType coin.Type) (*parameters.IotaCoinInfo, bool)
// CallView calls another contract. Only calls view entry points
CallView(Message) CallArguments
// StateR returns the immutable k/v store of the current call (in the context of the smart contract)
StateR() kv.KVStoreReader
// SchemaVersion returns the schema version of the current state
SchemaVersion() SchemaVersion
}
SandboxBase is the common interface of Sandbox and SandboxView
type SandboxView ¶
type SandboxView interface {
SandboxBase
}
SandboxView is an interface for read only call
type SchemaVersion ¶
type SchemaVersion uint32
type SendMetadata ¶
SendMetadata represents content of the data payload of the request
type SendOptions ¶
type SendOptions struct {
Timelock time.Time
Expiration *Expiration
}
type SimpleTokenScheme ¶
type SimpleTokenScheme struct {
// The amount of tokens which has been minted.
MintedTokens *big.Int
// The amount of tokens which has been melted.
MeltedTokens *big.Int
// The maximum supply of tokens controlled.
MaximumSupply *big.Int
}
func (*SimpleTokenScheme) Clone ¶
func (s *SimpleTokenScheme) Clone() *SimpleTokenScheme
type StateAnchor ¶
type StateAnchor struct {
// contains filtered or unexported fields
}
StateAnchor contains properties of the anchor request/transaction in the current context
func NewStateAnchor ¶
func NewStateAnchor( anchor *iscmove.AnchorWithRef, iscPackage iotago.Address, ) StateAnchor
NewStateAnchor creates a new state anchor. Every time changing the L1 state of the Anchor object, the nodes should create it. a latest StateAnchor, and remember to update the latest ObjectRef of GasCoin "changing the L1 state of the Anchor object" includes the following 'txbuilder' operations * BuildTransactionEssence (update the anchor commitment) * RotationTransaction
func (StateAnchor) Anchor ¶
func (s StateAnchor) Anchor() *iscmove.AnchorWithRef
func (StateAnchor) ChainID ¶
func (s StateAnchor) ChainID() ChainID
func (StateAnchor) Equals ¶
func (s StateAnchor) Equals(input *StateAnchor) bool
func (StateAnchor) GetAssetsBag ¶
func (s StateAnchor) GetAssetsBag() *iscmove.AssetsBag
func (StateAnchor) GetObjectID ¶
func (s StateAnchor) GetObjectID() *iotago.ObjectID
func (StateAnchor) GetObjectRef ¶
func (s StateAnchor) GetObjectRef() *iotago.ObjectRef
func (StateAnchor) GetStateIndex ¶
func (s StateAnchor) GetStateIndex() uint32
func (StateAnchor) GetStateMetadata ¶
func (s StateAnchor) GetStateMetadata() []byte
func (StateAnchor) Hash ¶
func (s StateAnchor) Hash() hashing.HashValue
func (*StateAnchor) ISCPackage ¶
func (s *StateAnchor) ISCPackage() iotago.Address
func (*StateAnchor) MarshalBCS ¶
func (s *StateAnchor) MarshalBCS(e *bcs.Encoder) error
func (StateAnchor) Owner ¶
func (s StateAnchor) Owner() *cryptolib.Address
func (StateAnchor) String ¶
func (s StateAnchor) String() string
func (*StateAnchor) UnmarshalBCS ¶
func (s *StateAnchor) UnmarshalBCS(d *bcs.Decoder) error
type UnresolvedVMError ¶
type UnresolvedVMError struct {
ErrorCode VMErrorCode `json:"code"`
Params []VMErrorParam `json:"params"`
}
func (*UnresolvedVMError) AsGoError ¶
func (e *UnresolvedVMError) AsGoError() error
func (*UnresolvedVMError) Bytes ¶
func (e *UnresolvedVMError) Bytes() []byte
func (*UnresolvedVMError) Code ¶
func (e *UnresolvedVMError) Code() VMErrorCode
func (*UnresolvedVMError) Error ¶
func (e *UnresolvedVMError) Error() string
type UnsignedOffLedgerRequest ¶
type UnsignedOffLedgerRequest interface {
Bytes() []byte
WithNonce(nonce uint64) UnsignedOffLedgerRequest
WithGasBudget(gasBudget uint64) UnsignedOffLedgerRequest
WithAllowance(allowance *Assets) UnsignedOffLedgerRequest
WithSender(sender *cryptolib.PublicKey) OffLedgerRequest
Sign(signer cryptolib.Signer) OffLedgerRequest
}
func NewOffLedgerRequest ¶
func NewOffLedgerRequest( chainID ChainID, msg Message, nonce uint64, gasBudget uint64, ) UnsignedOffLedgerRequest
type Utils ¶
Utils provides various utilities that are faster on host side than on VM interpreter side.
type VMError ¶
type VMError struct {
// contains filtered or unexported fields
}
func (*VMError) AsTemplate ¶
func (e *VMError) AsTemplate() *VMErrorTemplate
func (*VMError) AsUnresolvedError ¶
func (e *VMError) AsUnresolvedError() *UnresolvedVMError
func (*VMError) Code ¶
func (e *VMError) Code() VMErrorCode
func (*VMError) MessageFormat ¶
func (*VMError) Params ¶
func (e *VMError) Params() []VMErrorParam
type VMErrorBase ¶
type VMErrorBase interface {
error
Code() VMErrorCode
}
VMErrorBase is the common interface of UnresolvedVMError and VMError
type VMErrorCode ¶
func NewCoreVMErrorCode ¶
func NewCoreVMErrorCode(id uint16) VMErrorCode
func NewVMErrorCode ¶
func NewVMErrorCode(contractID Hname, id uint16) VMErrorCode
func VMErrorCodeFromBytes ¶
func VMErrorCodeFromBytes(b []byte) (VMErrorCode, error)
func (VMErrorCode) Bytes ¶
func (c VMErrorCode) Bytes() []byte
func (VMErrorCode) String ¶
func (c VMErrorCode) String() string
type VMErrorParam ¶
type VMErrorParam any
type VMErrorTemplate ¶
type VMErrorTemplate struct {
// contains filtered or unexported fields
}
func NewVMErrorTemplate ¶
func NewVMErrorTemplate(code VMErrorCode, messageFormat string) *VMErrorTemplate
func VMErrorTemplateFromBytes ¶
func VMErrorTemplateFromBytes(data []byte) (*VMErrorTemplate, error)
func (*VMErrorTemplate) Bytes ¶
func (e *VMErrorTemplate) Bytes() []byte
func (*VMErrorTemplate) Code ¶
func (e *VMErrorTemplate) Code() VMErrorCode
func (*VMErrorTemplate) Create ¶
func (e *VMErrorTemplate) Create(params ...VMErrorParam) *VMError
func (*VMErrorTemplate) Error ¶
func (e *VMErrorTemplate) Error() string
Error implements the error interface. VMErrorTemplate implements error just in case someone panics with it. VMErrorTemplate by mistake, so that we don't crash the VM because of that.
func (*VMErrorTemplate) MessageFormat ¶
func (e *VMErrorTemplate) MessageFormat() string
type VMProcessor ¶
type VMProcessor interface {
GetEntryPoint(code Hname) (VMProcessorEntryPoint, bool)
Entrypoints() map[Hname]ProcessorEntryPoint
}
VMProcessor is an interface to the VM processor instance.
type VMProcessorEntryPoint ¶
type VMProcessorEntryPoint interface {
Call(ctx SandboxBase) CallArguments
IsView() bool
}
VMProcessorEntryPoint is an abstract interface by which VM is called by passing the Sandbox interface
Source Files
¶
- agentid.go
- agentid_address.go
- agentid_contract.go
- agentid_eth.go
- agentid_nil.go
- assets.go
- chainid.go
- chaininfo.go
- consts.go
- contract_identity.go
- control_address.go
- doc.go
- dry_run_parsers.go
- event.go
- hname.go
- irc30nativetoken.go
- loginterface.go
- public_chain_metadata.go
- receipt.go
- request.go
- request_evmcall.go
- request_evmtx.go
- request_offledger.go
- request_onledger.go
- request_target.go
- requestimpl.go
- sandbox_interface.go
- sandboxview_interface.go
- vmerror.go
- vmprocessor.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package assert provides assertion utilities for the IOTA Smart Contract platform.
|
Package assert provides assertion utilities for the IOTA Smart Contract platform. |
|
package coreutil provides functions to describe interface of the core contract in a compact way
|
package coreutil provides functions to describe interface of the core contract in a compact way |
|
generator
command
|
|
|
Package isctest provides testing utilities and helpers for the ISC (IOTA Smart Contracts) package.
|
Package isctest provides testing utilities and helpers for the ISC (IOTA Smart Contracts) package. |