group contracts

C++ Contracts API for chain-dependent smart-contract functionality.

Modules

  • Action Defines type-safe C++ wrappers for querying action and sending action.
  • Contract Defines contract type which is base class for every EOSIO contract.
  • Dispatcher Defines C++ functions to dispatch action to proper action handler inside a contract.
  • Multi Index Table Defines EOSIO Multi Index Table.
  • Permission Defines C++ API functions for validating authorization of keys and permissions.
  • Privileged Defines C++ Privileged API.
  • Producer Key Maps producer with its signing key, used for producer schedule.
  • Producer Schedule Defines both the order, account name, and signing keys of the active set of producers.
  • Singleton Table Defines EOSIO Singleton Table used with multiindex.
  • Transaction Type-safe C++ wrappers for transaction C API.
  • System Defines wrappers over eosio_assert.

Functions Documentation

function check

void contracts::check (
    bool pred,
    const char * msg
)

Assert if the predicate fails and use the supplied message. Example:

eosio::check(a == b, "a does not equal b");

function check

void contracts::check (
    bool pred,
    const std::string & msg
)

Assert if the predicate fails and use the supplied message. Example:

eosio::check(a == b, "a does not equal b");

function check

void contracts::check (
    bool pred,
    std::string && msg
)

Assert if the predicate fails and use the supplied message. Example:

eosio::check(a == b, "a does not equal b");

function check

void contracts::check (
    bool pred,
    const char * msg,
    size_t n
)

Assert if the predicate fails and use a subset of the supplied message. Example:

const char* msg = "a does not equal b b does not equal a";
eosio::check(a == b, "a does not equal b", 18);

function check

void contracts::check (
    bool pred,
    const std::string & msg,
    size_t n
)

Assert if the predicate fails and use a subset of the supplied message. Example:

std::string msg = "a does not equal b b does not equal a";
eosio::check(a == b, msg, 18);

function check

void contracts::check (
    bool pred,
    uint64_t code
)

Assert if the predicate fails and use the supplied error code. Example:

eosio::check(a == b, 13);

function eosio_exit

void contracts::eosio_exit (
    int32_t code
)

This method will abort execution of wasm without failing the contract. This is used to bypass all cleanup / destructors that would normally be called.

Parameters:

  • code - the exit code Example:
eosio_exit(0);
eosio_exit(1);
eosio_exit(2);
eosio_exit(3);

function current_time_point

time_point contracts::current_time_point ()

Returns the time in microseconds from 1970 of the current block as a time_point

Returns:

time in microseconds from 1970 of the current block as a time_point

function current_block_time

block_timestamp contracts::current_block_time ()

Returns the time in microseconds from 1970 of the current block as a block_timestamp

Returns:

time in microseconds from 1970 of the current block as a block_timestamp

results matching ""

    No results matching ""