coreroot

package
v0.7.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: Apache-2.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScName        = "root"
	ScDescription = "Root Contract"
	HScName       = wasmtypes.ScHname(0xcebf5908)
)
View Source
const (
	ParamDeployer                 = "dp"
	ParamDeployPermissionsEnabled = "de"
	ParamHname                    = "hn"
	ParamInitParams               = "this"
	ParamName                     = "nm"
	ParamProgramHash              = "ph"
)
View Source
const (
	ResultContractFound    = "cf"
	ResultContractRecData  = "dt"
	ResultContractRegistry = "r"
)
View Source
const (
	FuncDeployContract           = "deployContract"
	FuncGrantDeployPermission    = "grantDeployPermission"
	FuncRequireDeployPermissions = "requireDeployPermissions"
	FuncRevokeDeployPermission   = "revokeDeployPermission"
	ViewFindContract             = "findContract"
	ViewGetContractRecords       = "getContractRecords"
)
View Source
const (
	HFuncDeployContract           = wasmtypes.ScHname(0x28232c27)
	HFuncGrantDeployPermission    = wasmtypes.ScHname(0xf440263a)
	HFuncRequireDeployPermissions = wasmtypes.ScHname(0xefff8d83)
	HFuncRevokeDeployPermission   = wasmtypes.ScHname(0x850744f1)
	HViewFindContract             = wasmtypes.ScHname(0xc145ca00)
	HViewGetContractRecords       = wasmtypes.ScHname(0x078b3ef3)
)

Variables

This section is empty.

Functions

func OnDispatch added in v1.0.3

func OnDispatch(index int32) *wasmlib.ScExportMap

Types

type CoreRootEventHandlers added in v1.0.3

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

func NewCoreRootEventHandlers added in v1.0.3

func NewCoreRootEventHandlers() *CoreRootEventHandlers

func (*CoreRootEventHandlers) CallHandler added in v1.0.3

func (h *CoreRootEventHandlers) CallHandler(topic string, dec *wasmtypes.WasmDecoder)

func (*CoreRootEventHandlers) ID added in v1.0.3

func (h *CoreRootEventHandlers) ID() uint32

func (*CoreRootEventHandlers) OnCoreRootDeploy added in v1.0.3

func (h *CoreRootEventHandlers) OnCoreRootDeploy(handler func(e *EventDeploy))

func (*CoreRootEventHandlers) OnCoreRootGrant added in v1.0.3

func (h *CoreRootEventHandlers) OnCoreRootGrant(handler func(e *EventGrant))

func (*CoreRootEventHandlers) OnCoreRootRevoke added in v1.0.3

func (h *CoreRootEventHandlers) OnCoreRootRevoke(handler func(e *EventRevoke))

type DeployContractCall

type DeployContractCall struct {
	Func   *wasmlib.ScFunc
	Params MutableDeployContractParams
}

type EventDeploy added in v1.0.3

type EventDeploy struct {
	Timestamp uint64
	Name      string
	ProgHash  wasmtypes.ScHash
}

type EventGrant added in v1.0.3

type EventGrant struct {
	Timestamp uint64
	Deployer  wasmtypes.ScAgentID
}

type EventRevoke added in v1.0.3

type EventRevoke struct {
	Timestamp uint64
	Deployer  wasmtypes.ScAgentID
}

type FindContractCall

type FindContractCall struct {
	Func    *wasmlib.ScView
	Params  MutableFindContractParams
	Results ImmutableFindContractResults
}

type Funcs

type Funcs struct{}
var ScFuncs Funcs

func (Funcs) DeployContract

func (sc Funcs) DeployContract(ctx wasmlib.ScFuncClientContext) *DeployContractCall

Deploys a non-EVM smart contract on the chain if the caller has deployment permission.

func (Funcs) FindContract

func (sc Funcs) FindContract(ctx wasmlib.ScViewClientContext) *FindContractCall

Returns the record for a given smart contract

func (Funcs) GetContractRecords

func (sc Funcs) GetContractRecords(ctx wasmlib.ScViewClientContext) *GetContractRecordsCall

Returns the list of all smart contracts deployed on the chain and their records.

func (Funcs) GrantDeployPermission

func (sc Funcs) GrantDeployPermission(ctx wasmlib.ScFuncClientContext) *GrantDeployPermissionCall

Grants deploy permission to an agent.

func (Funcs) RequireDeployPermissions added in v0.3.0

func (sc Funcs) RequireDeployPermissions(ctx wasmlib.ScFuncClientContext) *RequireDeployPermissionsCall

Enable or disable deploy permission check

func (Funcs) RevokeDeployPermission

func (sc Funcs) RevokeDeployPermission(ctx wasmlib.ScFuncClientContext) *RevokeDeployPermissionCall

Revokes deploy permission for an agent.

type GetContractRecordsCall

type GetContractRecordsCall struct {
	Func    *wasmlib.ScView
	Results ImmutableGetContractRecordsResults
}

type GrantDeployPermissionCall

type GrantDeployPermissionCall struct {
	Func   *wasmlib.ScFunc
	Params MutableGrantDeployPermissionParams
}

type ImmutableDeployContractParams

type ImmutableDeployContractParams struct {
	Proxy wasmtypes.Proxy
}

func NewImmutableDeployContractParams added in v1.0.3

func NewImmutableDeployContractParams() ImmutableDeployContractParams

func (ImmutableDeployContractParams) InitParams added in v1.0.3

additional params for smart contract init function

func (ImmutableDeployContractParams) Name

The name of the contract to be deployed, used to calculate the contract's hname. The hname must be unique among all contract hnames in the chain.

func (ImmutableDeployContractParams) ProgramHash

hash of blob that has been previously stored in blob contract

type ImmutableFindContractParams

type ImmutableFindContractParams struct {
	Proxy wasmtypes.Proxy
}

func NewImmutableFindContractParams added in v1.0.3

func NewImmutableFindContractParams() ImmutableFindContractParams

func (ImmutableFindContractParams) Hname

The smart contract’s Hname

type ImmutableFindContractResults

type ImmutableFindContractResults struct {
	Proxy wasmtypes.Proxy
}

func (ImmutableFindContractResults) ContractFound

whether the contract exists.

func (ImmutableFindContractResults) ContractRecData

encoded contract record (if exists)

type ImmutableGetContractRecordsResults

type ImmutableGetContractRecordsResults struct {
	Proxy wasmtypes.Proxy
}

func (ImmutableGetContractRecordsResults) ContractRegistry

contract records by Hname

type ImmutableGrantDeployPermissionParams

type ImmutableGrantDeployPermissionParams struct {
	Proxy wasmtypes.Proxy
}

func NewImmutableGrantDeployPermissionParams added in v1.0.3

func NewImmutableGrantDeployPermissionParams() ImmutableGrantDeployPermissionParams

func (ImmutableGrantDeployPermissionParams) Deployer

agent to grant deploy permission to

type ImmutableRequireDeployPermissionsParams added in v0.3.0

type ImmutableRequireDeployPermissionsParams struct {
	Proxy wasmtypes.Proxy
}

func NewImmutableRequireDeployPermissionsParams added in v1.0.3

func NewImmutableRequireDeployPermissionsParams() ImmutableRequireDeployPermissionsParams

func (ImmutableRequireDeployPermissionsParams) DeployPermissionsEnabled added in v0.3.0

turns permission check on or off

type ImmutableRevokeDeployPermissionParams

type ImmutableRevokeDeployPermissionParams struct {
	Proxy wasmtypes.Proxy
}

func NewImmutableRevokeDeployPermissionParams added in v1.0.3

func NewImmutableRevokeDeployPermissionParams() ImmutableRevokeDeployPermissionParams

func (ImmutableRevokeDeployPermissionParams) Deployer

agent to revoke deploy permission for

type MapHnameToImmutableBytes

type MapHnameToImmutableBytes struct {
	Proxy wasmtypes.Proxy
}

func (MapHnameToImmutableBytes) GetBytes

type MapHnameToMutableBytes

type MapHnameToMutableBytes struct {
	Proxy wasmtypes.Proxy
}

func (MapHnameToMutableBytes) Clear

func (m MapHnameToMutableBytes) Clear()

func (MapHnameToMutableBytes) GetBytes

type MapStringToImmutableBytes added in v1.0.3

type MapStringToImmutableBytes struct {
	Proxy wasmtypes.Proxy
}

func (MapStringToImmutableBytes) GetBytes added in v1.0.3

type MapStringToMutableBytes added in v1.0.3

type MapStringToMutableBytes struct {
	Proxy wasmtypes.Proxy
}

func (MapStringToMutableBytes) Clear added in v1.0.3

func (m MapStringToMutableBytes) Clear()

func (MapStringToMutableBytes) GetBytes added in v1.0.3

type MutableDeployContractParams

type MutableDeployContractParams struct {
	Proxy wasmtypes.Proxy
}

func (MutableDeployContractParams) InitParams added in v1.0.3

additional params for smart contract init function

func (MutableDeployContractParams) Name

The name of the contract to be deployed, used to calculate the contract's hname. The hname must be unique among all contract hnames in the chain.

func (MutableDeployContractParams) ProgramHash

hash of blob that has been previously stored in blob contract

type MutableFindContractParams

type MutableFindContractParams struct {
	Proxy wasmtypes.Proxy
}

func (MutableFindContractParams) Hname

The smart contract’s Hname

type MutableFindContractResults

type MutableFindContractResults struct {
	Proxy wasmtypes.Proxy
}

func NewMutableFindContractResults added in v1.0.3

func NewMutableFindContractResults() MutableFindContractResults

func (MutableFindContractResults) ContractFound

whether the contract exists.

func (MutableFindContractResults) ContractRecData

encoded contract record (if exists)

type MutableGetContractRecordsResults

type MutableGetContractRecordsResults struct {
	Proxy wasmtypes.Proxy
}

func NewMutableGetContractRecordsResults added in v1.0.3

func NewMutableGetContractRecordsResults() MutableGetContractRecordsResults

func (MutableGetContractRecordsResults) ContractRegistry

contract records by Hname

type MutableGrantDeployPermissionParams

type MutableGrantDeployPermissionParams struct {
	Proxy wasmtypes.Proxy
}

func (MutableGrantDeployPermissionParams) Deployer

agent to grant deploy permission to

type MutableRequireDeployPermissionsParams added in v0.3.0

type MutableRequireDeployPermissionsParams struct {
	Proxy wasmtypes.Proxy
}

func (MutableRequireDeployPermissionsParams) DeployPermissionsEnabled added in v0.3.0

func (s MutableRequireDeployPermissionsParams) DeployPermissionsEnabled() wasmtypes.ScMutableBool

turns permission check on or off

type MutableRevokeDeployPermissionParams

type MutableRevokeDeployPermissionParams struct {
	Proxy wasmtypes.Proxy
}

func (MutableRevokeDeployPermissionParams) Deployer

agent to revoke deploy permission for

type RequireDeployPermissionsCall added in v0.3.0

type RequireDeployPermissionsCall struct {
	Func   *wasmlib.ScFunc
	Params MutableRequireDeployPermissionsParams
}

type RevokeDeployPermissionCall

type RevokeDeployPermissionCall struct {
	Func   *wasmlib.ScFunc
	Params MutableRevokeDeployPermissionParams
}

Jump to

Keyboard shortcuts

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