Versions in this module Expand all Collapse all v0 v0.34.4 Jul 23, 2021 Changes in this version + var Permissions = New().MustContract("Permissions", ..., Function{ ... }, Function{ ... }, Function{ ... }, ...) + var Precompiles = ...(`Compute the keccak256 hash of input`, leftPadAddress(20), permission.None, ...) + type Context struct + Logger *logging.Logger + State engine.State + type Contract struct + Comment string + Name string + func NewContract(name string, comment string, logger *logging.Logger, fs ...Function) (*Contract, error) + func (c *Contract) Address() crypto.Address + func (c *Contract) Call(state engine.State, params engine.CallParams) (output []byte, err error) + func (c *Contract) ContractMeta() []*acm.ContractMeta + func (c *Contract) FullName() string + func (c *Contract) FunctionByID(id abi.FunctionID) (*Function, errors.CodedError) + func (c *Contract) FunctionByName(name string) *Function + func (c *Contract) Functions() []*Function + func (c *Contract) SetExternals(externals engine.Dispatcher) + type Function struct + Comment string + F interface{} + PermFlag permission.PermFlag + Pure bool + func NewFunction(comment string, address crypto.Address, permFlag permission.PermFlag, ...) (*Function, error) + func (f *Function) Abi() *abi.FunctionSpec + func (f *Function) Address() crypto.Address + func (f *Function) Call(state engine.State, params engine.CallParams) ([]byte, error) + func (f *Function) ContractMeta() []*acm.ContractMeta + func (f *Function) FullName() string + func (f *Function) NArgs() int + func (f *Function) Name() string + func (f *Function) SetExternals(externals engine.Dispatcher) + func (f *Function) Signature() string + func (f *Function) String() string + type Natives struct + func DefaultNatives() (*Natives, error) + func Merge(nss ...*Natives) (*Natives, error) + func MustDefaultNatives() *Natives + func New() *Natives + func (ns *Natives) Callables() []engine.Callable + func (ns *Natives) Contract(name, comment string, functions ...Function) (*Natives, error) + func (ns *Natives) Dispatch(acc *acm.Account) engine.Callable + func (ns *Natives) Function(comment string, address crypto.Address, permFlag permission.PermFlag, ...) (*Natives, error) + func (ns *Natives) GetByAddress(address crypto.Address) engine.Native + func (ns *Natives) GetByName(name string) engine.Native + func (ns *Natives) GetContract(name string) *Contract + func (ns *Natives) GetFunction(name string) *Function + func (ns *Natives) IsRegistered(address crypto.Address) bool + func (ns *Natives) MustContract(name, comment string, functions ...Function) *Natives + func (ns *Natives) MustFunction(comment string, address crypto.Address, permFlag permission.PermFlag, ...) *Natives + func (ns *Natives) SetExternals(externals engine.Dispatcher) + func (ns *Natives) WithLogger(logger *logging.Logger) *Natives + type State struct + func NewState(natives engine.Natives, backend acmstate.ReaderWriter) *State + func (s *State) GetAccount(address crypto.Address) (*acm.Account, error) + func (s *State) GetStorage(address crypto.Address, key binary.Word256) ([]byte, error) + func (s *State) RemoveAccount(address crypto.Address) error + func (s *State) SetStorage(address crypto.Address, key binary.Word256, value []byte) error + func (s *State) UpdateAccount(updatedAccount *acm.Account) error