跳到主要内容

libraries/eosiolib/contracts/eosio/contract.hpp

Namespaces

Name
eosio

Classes

Name
classeosio::contract

Defines

Name
CONTRACT
ACTION
TABLE

Macros Documentation

define CONTRACT

#define CONTRACT class [[eosio::contract]]

Helper macros to reduce the verbosity for common contracts

define ACTION

#define ACTION [[eosio::action]] void

define TABLE

#define TABLE struct [[eosio::table]]

Source code

#pragma once

#include "../../core/eosio/name.hpp"
#include "../../core/eosio/datastream.hpp"


#define CONTRACT class [[eosio::contract]]
#define ACTION [[eosio::action]] void
#define TABLE struct [[eosio::table]]

namespace eosio {

class contract {
public:
contract( name self, name first_receiver, datastream<const char*> ds ):_self(self),_first_receiver(first_receiver),_ds(ds) {}

inline name get_self()const { return _self; }

[[deprecated]]
inline name get_code()const { return _first_receiver; }

inline name get_first_receiver()const { return _first_receiver; }

inline datastream<const char*>& get_datastream() { return _ds; }

inline const datastream<const char*>& get_datastream()const { return _ds; }

protected:
name _self;

name _first_receiver;

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

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