跳到主要内容

eosio::contract

Module: Contracts API / Contract

More...

#include <contract.hpp>

Public Functions

Name
contract(name self, name first_receiver, datastream< const char * > ds)
nameget_self() const
nameget_code() const
nameget_first_receiver() const
datastream< const char * > &get_datastream()
const datastream< const char * > &get_datastream() const

Protected Attributes

Name
name_self
name_first_receiver
datastream< const char * >_ds

Detailed Description

class eosio::contract;

Base class for EOSIO contract.

A new contract should derive from this class, so it can make use of EOSIO_ABI macro.

Public Functions Documentation

function contract

inline contract(
name self,
name first_receiver,
datastream< const char * > ds
)

Parameters:

  • self - The name of the account this contract is deployed on
  • first_receiver - The account the incoming action was first received at.
  • ds - The datastream used

Construct a new contract given the contract name

function get_self

inline name get_self() const

Return: name - The name of this contract

Get this contract name

function get_code

inline name get_code() const

Return: name - The first_receiver name of the action this contract is processing.

The first_receiver name of the action this contract is processing.

function get_first_receiver

inline name get_first_receiver() const

Return: name - The first_receiver name of the action this contract is processing.

The account the incoming action was first received at.

function get_datastream

inline datastream< const char * > & get_datastream()

Return: datastream<const char*> - The datastream for this contract

Get the datastream for this contract

function get_datastream

inline const datastream< const char * > & get_datastream() const

Return: datastream<const char*> - The datastream for this contract

Get the datastream for this contract

Protected Attributes Documentation

variable _self

name _self;

The name of the account this contract is deployed on.

variable _first_receiver

name _first_receiver;

The account the incoming action was first received at.

variable _ds

datastream< const char * > _ds = datastream<const char*>(nullptr, 0);

The datastream for this contract


Updated on 2022-12-05 at 15:38:07 +0000