System

Defines wrappers over eosio_assert. More...

Functions

Detailed Description

Defines time related functions and eosio_exit.

Functions Documentation

function eosio_exit

void eosio::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 eosio::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 eosio::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

function is_feature_activated

bool eosio::is_feature_activated(
    const checksum256 & feature_digest
)

Check if specified protocol feature has been activated

Parameters:

  • feature_digest - digest of the protocol feature

Returns:

true if the specified protocol feature has been activated, false otherwise

function get_sender

name eosio::get_sender()

Return name of account that sent current inline action

Returns:

name of account that sent the current inline action (empty name if not called from inline action)

function check

void eosio::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 eosio::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 eosio::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 eosio::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 eosio::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 eosio::check(
    bool pred,
    uint64_t code
)

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

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