namespace eosio
Classes
Type | Name |
---|---|
struct | action |
struct | action_wrapper Used to wrap an a particular action to simplify the process of other contracts sending inline actions to "wrapped" action. Example: |
struct | asset |
class | binary_extension |
struct | block_signing_authority_v0 weighted threshold multi-sig authority |
class | block_timestamp |
struct | blockchain_parameters |
struct | const_mem_fun |
class | contract |
class | datastream |
class | datastream< size_t > |
struct | extended_asset |
class | extended_symbol |
class | fixed_bytes |
struct | ignore |
struct | ignore_wrapper |
struct | indexed_by |
struct | inline_dispatcher |
struct | inline_dispatcher< void(T::*)(Args...), Name > |
class | iostream |
struct | key_weight |
struct | kv_parameters |
class | microseconds |
class | multi_index Defines EOSIO Multi Index Table. |
struct | name |
struct | onerror |
struct | overloaded |
struct | permission_level |
struct | producer_authority Maps producer with its signing key. |
struct | producer_key |
struct | producer_schedule |
class | rope |
struct | security_group |
struct | signed_int |
class | singleton |
class | string |
class | symbol |
class | symbol_code |
class | time_point |
class | time_point_sec |
class | transaction |
class | transaction_header Contains details about the transaction. |
struct | unsigned_int |
struct | variant_action_wrapper |
Typedefs
Type | Name |
---|---|
typedef std::variant< block_signing_authority_v0 > | block_signing_authority |
typedef std::tuple< uint16_t, std::vector< char > > | extension |
typedef std::vector< extension > | extensions_type |
typedef std::string | key_type |
typedef block_timestamp | block_timestamp_type |
Variables
Type | Name |
---|---|
static constexpr static name | same_payer |
constexpr auto | powers_of_base |
static iostream | cout |
Functions
Type | Name |
---|---|
T | unpack_action_data () |
void | require_recipient (name notify_account) Add the specified account to set of accounts to be notified. |
void | require_recipient (name notify_account, accounts... remaining_accounts) |
void | require_auth (name n) |
time_point | publication_time () Get the publication time. |
name | current_receiver () Get the current receiver of the action. |
uint32_t | read_action_data (void * msg, uint32_t len) Copy current action data to the specified location. |
uint32_t | action_data_size () Get the length of current action's data field. |
void | require_auth (const permission_level & level) |
bool | has_auth (name n) |
bool | is_account (name n) |
void | dispatch_inline (name code, name act, std::vector< permission_level > perms, std::tuple< Args... > args) |
bool | dispatch (uint64_t code, uint64_t act) |
bool | execute_action (name self, name code, void(T::*)(Args...) func) |
bool | check_transaction_authorization (const char * trx_data, uint32_t trx_size, const char * pubkeys_data, uint32_t pubkeys_size, const char * perms_data, uint32_t perms_size) |
bool | check_permission_authorization (name account, name permission, const char * pubkeys_data, uint32_t pubkeys_size, const char * perms_data, uint32_t perms_size, microseconds delay) |
bool | check_transaction_authorization (const transaction & trx, const std::set< permission_level > & provided_permissions, const std::set< public_key > & provided_keys = std::set< public_key >()) |
bool | check_permission_authorization (name account, name permission, const std::set< public_key > & provided_keys, const std::set< permission_level > & provided_permissions = std::set< permission_level >(), microseconds provided_delay = microseconds{std::numeric_limits< int64_t >::max()}) |
time_point | get_permission_last_used (name account, name permission) |
time_point | get_account_creation_time (name account) |
void | set_blockchain_parameters (const eosio::blockchain_parameters & params) |
void | get_blockchain_parameters (eosio::blockchain_parameters & params) |
void | set_kv_parameters (const eosio::kv_parameters & params) |
void | get_resource_limits (name account, int64_t & ram_bytes, int64_t & net_weight, int64_t & cpu_weight) |
void | set_resource_limits (name account, int64_t ram_bytes, int64_t net_weight, int64_t cpu_weight) |
std::optional< uint64_t > | set_proposed_producers (const std::vector< producer_key > & prods) |
std::optional< uint64_t > | set_proposed_producers (const std::vector< producer_authority > & prods) |
bool | is_privileged (name account) |
void | set_privileged (name account, bool is_priv) |
void | preactivate_feature (const checksum256 & feature_digest) |
std::vector< name > | get_active_producers () |
int64_t | add_security_group_participants (const std::set< name > & participants) |
int64_t | remove_security_group_participants (const std::set< name > & participants) |
bool | in_active_security_group (const std::set< name > & participants) |
security_group | get_active_security_group () |
void | eosio_exit (int32_t code) |
time_point | current_time_point () |
block_timestamp | current_block_time () |
bool | is_feature_activated (const checksum256 & feature_digest) |
name | get_sender () |
void | send_deferred (const uint128_t & sender_id, name payer, const char * serialized_transaction, size_t size, bool replace = false) |
action | get_action (uint32_t type, uint32_t index) |
size_t | read_transaction (char * ptr, size_t sz) Access a copy of the currently executing transaction. |
int | cancel_deferred (const uint128_t & sender_id) |
size_t | transaction_size () Gets the size of the currently executing transaction. |
int | tapos_block_num () Gets the block number used for TAPOS on the currently executing transaction. |
int | tapos_block_prefix () Gets the block prefix used for TAPOS on the currently executing transaction. |
uint32_t | expiration () Gets the expiration of the currently executing transaction. |
int | get_context_free_data (uint32_t index, char * buff, size_t size) Retrieve the signed_transaction.context_free_data[index]. |
char * | write_decimal (char * begin, char * end, bool dry_run, uint64_t number, uint8_t num_decimal_places, bool negative) |
void | check (bool pred, std::string_view msg) |
void | check (bool pred, const char * msg) |
void | check (bool pred, const std::string & msg) |
void | check (bool pred, std::string && msg) |
void | check (bool pred, const char * msg, size_t n) |
void | check (bool pred, const std::string & msg, size_t n) |
void | check (bool pred, uint64_t code) |
name | current_context_contract () |
datastream< Stream > & | operator<< (datastream< Stream > & ds, const std::list< T > & l) |
datastream< Stream > & | operator>> (datastream< Stream > & ds, std::list< T > & l) |
datastream< Stream > & | operator<< (datastream< Stream > & ds, const std::deque< T > & d) |
datastream< Stream > & | operator>> (datastream< Stream > & ds, std::deque< T > & d) |
datastream< Stream > & | operator<< (datastream< Stream > & ds, const std::variant< Ts... > & var) |
void | deserialize (datastream< Stream > & ds, std::variant< Ts... > & var, int i) |
datastream< Stream > & | operator>> (datastream< Stream > & ds, std::variant< Ts... > & var) |
datastream< Stream > & | operator<< (datastream< Stream > & ds, const std::pair< T1, T2 > & t) |
datastream< Stream > & | operator>> (datastream< Stream > & ds, std::pair< T1, T2 > & t) |
datastream< Stream > & | operator<< (datastream< Stream > & ds, const std::optional< T > & opt) |
datastream< Stream > & | operator>> (datastream< Stream > & ds, std::optional< T > & opt) |
datastream< Stream > & | operator<< (datastream< Stream > & ds, const bool & d) |
datastream< Stream > & | operator>> (datastream< Stream > & ds, bool & d) |
datastream< Stream > & | operator<< (datastream< Stream > & ds, const std::string & v) |
datastream< Stream > & | operator>> (datastream< Stream > & ds, std::string & v) |
datastream< Stream > & | operator<< (datastream< Stream > & ds, const std::array< T, N > & v) |
datastream< Stream > & | operator>> (datastream< Stream > & ds, std::array< T, N > & v) |
datastream< Stream > & | operator>> (datastream< Stream > & ds, T) Pointer should not be serialized, so this function will always throws an error. |
datastream< Stream > & | operator<< (datastream< Stream > & ds, const T(&) v) |
datastream< Stream > & | operator>> (datastream< Stream > & ds, T(&) v) |
datastream< Stream > & | operator<< (datastream< Stream > & ds, const std::vector< char > & v) |
datastream< Stream > & | operator<< (datastream< Stream > & ds, const std::vector< T > & v) |
datastream< Stream > & | operator>> (datastream< Stream > & ds, std::vector< char > & v) |
datastream< Stream > & | operator>> (datastream< Stream > & ds, std::vector< T > & v) |
datastream< Stream > & | operator<< (datastream< Stream > & ds, const std::set< T > & s) |
datastream< Stream > & | operator>> (datastream< Stream > & ds, std::set< T > & s) |
datastream< Stream > & | operator<< (datastream< Stream > & ds, const std::map< K, V > & m) |
datastream< Stream > & | operator>> (datastream< Stream > & ds, std::map< K, V > & m) |
datastream< Stream > & | operator<< (datastream< Stream > & ds, const std::tuple< Args... > & t) |
datastream< Stream > & | operator>> (datastream< Stream > & ds, std::tuple< Args... > & t) |
DataStream & | operator<< (DataStream & ds, const T & v) |
DataStream & | operator>> (DataStream & ds, T & v) |
datastream< Stream > & | operator<< (datastream< Stream > & ds, const T & v) |
datastream< Stream > & | operator>> (datastream< Stream > & ds, T & v) |
T | unpack (const char * buffer, size_t len) |
void | unpack (T & res, const char * buffer, size_t len) |
T | unpack (const std::vector< char > & bytes) |
size_t | pack_size (const T & value) |
std::vector< char > | pack (const T & value) |
DataStream & | operator<< (DataStream & ds, const ::eosio::ignore_wrapper< T > & val) Serialize ignored_wrapper |
DataStream & | operator<< (DataStream & ds, const ::eosio::ignore< T > & val) Serialize an ignored type. |
DataStream & | operator>> (DataStream & ds, ::eosio::ignore< T > &) Deserialize an ignored type. |
void | to_key (const T & obj, datastream< S > & stream) |
void | to_key_tuple (const T & obj, datastream< S > & stream) |
void | to_key (const std::tuple< Ts... > & obj, datastream< S > & stream) |
void | to_key (const std::array< T, N > & obj, datastream< S > & stream) |
void | to_key_optional (const bool * obj, datastream< S > & stream) |
void | to_key_optional (const T * obj, datastream< S > & stream) |
void | to_key (const std::pair< T, U > & obj, datastream< S > & stream) |
void | to_key_range (const T & obj, datastream< S > & stream) |
auto | to_key (const T & obj, datastream< S > & stream) |
void | to_key (const std::map< T, U > & obj, datastream< S > & stream) |
void | to_key (const std::optional< T > & obj, datastream< S > & stream) |
void | to_key_varuint32 (std::uint32_t obj, datastream< S > & stream) |
void | to_key_varint32 (std::int32_t obj, datastream< S > & stream) |
void | to_key (const std::variant< Ts... > & obj, datastream< S > & stream) |
void | to_key (const char(&) str, datastream< S > & stream) |
void | to_key (std::string_view obj, datastream< S > & stream) |
void | to_key (const std::string & obj, datastream< S > & stream) |
void | to_key (bool obj, datastream< S > & stream) |
UInt | float_to_key (T value) |
void | convert_to_key (const T & t, key_type & bin) |
key_type | convert_to_key (const T & t) |
constexpr T | pow (uint8_t exponent) |
void | printhex (const void * ptr, uint32_t size) Prints hexidecimal data of length datalen. |
void | printl (const char * ptr, size_t len) |
void | print (const char * ptr) |
void | print (T num) |
void | print (float num) |
void | print (double num) |
void | print (long double num) |
void | print (T && t) |
void | print_f (const char * s) |
void | print_f (const char * s, Arg val, Args... rest) |
void | print (Arg && a, Args &&... args) |
overloaded (Ts...) | |
bool | operator< (const string & lhs, const string & rhs) |
bool | operator> (const string & lhs, const string & rhs) |
bool | operator<= (const string & lhs, const string & rhs) |
bool | operator>= (const string & lhs, const string & rhs) |
bool | operator== (const string & lhs, const string & rhs) |
bool | operator!= (const string & lhs, const string & rhs) |
string | operator+ (const string & lhs, const string & rhs) |
DataStream & | operator<< (DataStream & ds, const string & str) |
DataStream & | operator>> (DataStream & ds, string & str) |
DataStream & | operator<< (DataStream & ds, const eosio::symbol_code sym_code) |
DataStream & | operator>> (DataStream & ds, eosio::symbol_code & sym_code) |
DataStream & | operator<< (DataStream & ds, const eosio::symbol sym) Serialize a symbol. |
DataStream & | operator>> (DataStream & ds, eosio::symbol & sym) Deserialize a symbol. |
microseconds | seconds (int64_t s) |
microseconds | milliseconds (int64_t s) |
microseconds | minutes (int64_t m) |
microseconds | hours (int64_t h) |
microseconds | days (int64_t d) |
Typedefs Documentation
typedef block_signing_authority
using eosio::block_signing_authority = typedef std::variant<block_signing_authority_v0>;
variant of all possible block signing authorities
typedef extension
typedef std::tuple<uint16_t, std::vector<char> > eosio::extension;
typedef extensions_type
typedef std::vector<extension> eosio::extensions_type;
typedef key_type
using eosio::key_type = typedef std::string;
typedef block_timestamp_type
typedef block_timestamp eosio::block_timestamp_type;
Variables Documentation
variable same_payer
constexpr static name eosio::same_payer;
variable powers_of_base
constexpr auto eosio::powers_of_base;
variable cout
iostream eosio::cout;
Functions Documentation
function unpack_action_data
template<typename T>
T eosio::unpack_action_data()
Returns:
Unpacked action data casted as T.
Example:
struct dummy_action {
char a; //1
unsigned long long b; //8
int c; //4
EOSLIB_SERIALIZE( dummy_action, (a)(b)(c) )
};
dummy_action msg = unpack_action_data<dummy_action>();
function require_recipient (1/2)
void eosio::require_recipient(
name notify_account
)
Add the specified account to set of accounts to be notified.
Add the specified account to set of accounts to be notified
Parameters:
- notify_account - name of the account to be verified
function require_recipient (2/2)
template<typename... accounts>
void eosio::require_recipient(
name notify_account,
accounts... remaining_accounts
)
All of the listed accounts will be added to the set of accounts to be notified This helper method enables you to add multiple accounts to accounts to be notified list with a single call rather than having to call the similar C API multiple times.
Parameters:
- notify_account account to be notified
- remaining_accounts accounts to be notified
Note:
action.code is also considered as part of the set of notified accounts
Example:
require_recipient("Account1"_n, "Account2"_n, "Account3"_n); // throws exception if any of them not in set.
function require_auth (1/2)
void eosio::require_auth(
name n
)
Verifies that Name exists in the set of provided auths on a action. Fails if not found.
Parameters:
- name - name of the account to be verified
function publication_time
time_point eosio::publication_time()
Get the publication time.
Returns the time in microseconds from 1970 of the publication_time
Returns:
the time in microseconds from 1970 of the publication_time
function current_receiver
name eosio::current_receiver()
Get the current receiver of the action.
Get the current receiver of the action
Returns:
the account which specifies the current receiver of the action
function read_action_data
uint32_t eosio::read_action_data(
void * msg,
uint32_t len
)
Copy current action data to the specified location.
Copy up to length bytes of current action data to the specified location
Parameters:
- msg - a pointer where up to length bytes of the current action data will be copied
- len - len of the current action data to be copied, 0 to report required size
Returns:
the number of bytes copied to msg, or number of bytes that can be copied if len==0 passed
Precondition:
msg
is a valid pointer to a range of memory at least len
bytes long
Post
msg
is filled with packed action data
function action_data_size
uint32_t eosio::action_data_size()
Get the length of current action's data field.
Get the length of the current action's data field. This method is useful for dynamically sized actions
Returns:
the length of the current action's data field
function require_auth (2/2)
void eosio::require_auth(
const permission_level & level
)
Require the specified authorization for this action. If this action doesn't contain the specified auth, it will fail.
Parameters:
- level - Authorization to be required
function has_auth
bool eosio::has_auth(
name n
)
Verifies that n has auth.
Parameters:
- n - name of the account to be verified
function is_account
bool eosio::is_account(
name n
)
Verifies that n is an existing account.
Parameters:
- n - name of the account to check
function dispatch_inline
template<typename... Args>
void eosio::dispatch_inline(
name code,
name act,
std::vector< permission_level > perms,
std::tuple< Args... > args
)
function dispatch
template<typename Contract, typename FirstAction, typename SecondAction, typename... Actions>
bool eosio::dispatch(
uint64_t code,
uint64_t act
)
This method will dynamically dispatch an incoming set of actions to
static Contract::on( ActionType )
For this to work the Actions must be derived from eosio::contract
function execute_action
template<typename T, typename... Args>
bool eosio::execute_action(
name self,
name code,
void(T::*)(Args...) func
)
Unpack the received action and execute the correponding action handler
Template parameters:
- T - The contract class that has the correponding action handler, this contract should be derived from eosio::contract
- Q - The namespace of the action handler function
- Args - The arguments that the action handler accepts, i.e. members of the action
Parameters:
- obj - The contract object that has the correponding action handler
- func - The action handler
Returns:
true
function check_transaction_authorization
bool eosio::check_transaction_authorization(
const char * trx_data,
uint32_t trx_size,
const char * pubkeys_data,
uint32_t pubkeys_size,
const char * perms_data,
uint32_t perms_size
)
Checks if a transaction is authorized by a provided set of keys and permissions
Parameters:
- trx_data - pointer to the start of the serialized transaction
- trx_size - size (in bytes) of the serialized transaction
- pubkeys_data - pointer to the start of the serialized vector of provided public keys
- pubkeys_size - size (in bytes) of serialized vector of provided public keys (can be 0 if no public keys are to be provided)
- perms_data - pointer to the start of the serialized vector of provided permissions (empty permission name acts as wildcard)
- perms_size - size (in bytes) of the serialized vector of provided permissions
Returns:
1 if the transaction is authorized, 0 otherwise
function check_permission_authorization
bool eosio::check_permission_authorization(
name account,
name permission,
const char * pubkeys_data,
uint32_t pubkeys_size,
const char * perms_data,
uint32_t perms_size,
microseconds delay
)
Checks if a permission is authorized by a provided delay and a provided set of keys and permissions
Parameters:
- account - the account owner of the permission
- permission - the name of the permission to check for authorization
- pubkeys_data - pointer to the start of the serialized vector of provided public keys
- pubkeys_size - size (in bytes) of serialized vector of provided public keys (can be 0 if no public keys are to be provided)
- perms_data - pointer to the start of the serialized vector of provided permissions (empty permission name acts as wildcard)
- perms_size - size (in bytes) of the serialized vector of provided permissions
- delay - the provided delay in microseconds (cannot exceed INT64_MAX)
Returns:
1 if the permission is authorized, 0 otherwise
function check_transaction_authorization
bool eosio::check_transaction_authorization(
const transaction & trx,
const std::set< permission_level > & provided_permissions,
const std::set< public_key > & provided_keys = std::set< public_key >()
)
Checks if a transaction is authorized by a provided set of keys and permissions
Parameters:
- trx - the transaction for which to check authorizations
- provided_permissions - the set of permissions which have authorized the transaction (empty permission name acts as wildcard)
- provided_keys - the set of public keys which have authorized the transaction
Returns:
whether the transaction was authorized by provided keys and permissions
function check_permission_authorization
bool eosio::check_permission_authorization(
name account,
name permission,
const std::set< public_key > & provided_keys,
const std::set< permission_level > & provided_permissions = std::set< permission_level >(),
microseconds provided_delay = microseconds{std::numeric_limits< int64_t >::max()}
)
Checks if a permission is authorized by a provided delay and a provided set of keys and permissions
Parameters:
- account - the account owner of the permission
- permission - the permission name to check for authorization
- provided_keys - the set of public keys which have authorized the transaction
- provided_permissions - the set of permissions which have authorized the transaction (empty permission name acts as wildcard)
- provided_delay_us - the provided delay in microseconds (cannot exceed INT64_MAX)
Returns:
whether the permission was authorized by provided delay, keys, and permissions
function get_permission_last_used
time_point eosio::get_permission_last_used(
name account,
name permission
)
Returns the last used time of a permission
Parameters:
- account - the account owner of the permission
- permission - the name of the permission
Returns:
the last used time (in microseconds since Unix epoch) of the permission
function get_account_creation_time
time_point eosio::get_account_creation_time(
name account
)
Returns the creation time of an account
Parameters:
- account - the account
Returns:
the creation time (in microseconds since Unix epoch) of the account
function set_blockchain_parameters
void eosio::set_blockchain_parameters(
const eosio::blockchain_parameters & params
)
Set the blockchain parameters
Parameters:
- params - New blockchain parameters to set
function get_blockchain_parameters
void eosio::get_blockchain_parameters(
eosio::blockchain_parameters & params
)
Retrieve the blolckchain parameters
Parameters:
- params - It will be replaced with the retrieved blockchain params
function set_kv_parameters
void eosio::set_kv_parameters(
const eosio::kv_parameters & params
)
Set the kv parameters
Parameters:
- params - New kv parameters to set
function get_resource_limits
void eosio::get_resource_limits(
name account,
int64_t & ram_bytes,
int64_t & net_weight,
int64_t & cpu_weight
)
Get the resource limits of an account
Parameters:
- account - name of the account whose resource limit to get
- ram_bytes - output to hold retrieved ram limit in absolute bytes
- net_weight - output to hold net limit
- cpu_weight - output to hold cpu limit
function set_resource_limits
void eosio::set_resource_limits(
name account,
int64_t ram_bytes,
int64_t net_weight,
int64_t cpu_weight
)
Set the resource limits of an account
Parameters:
- account - name of the account whose resource limit to be set
- ram_bytes - ram limit in absolute bytes
- net_weight - fractionally proportionate net limit of available resources based on (weight / total_weight_of_all_accounts)
- cpu_weight - fractionally proportionate cpu limit of available resources based on (weight / total_weight_of_all_accounts)
function set_proposed_producers (1/2)
std::optional<uint64_t> eosio::set_proposed_producers(
const std::vector< producer_key > & prods
)
Proposes a schedule change using the legacy producer key format
Note:
Once the block that contains the proposal becomes irreversible, the schedule is promoted to "pending" automatically. Once the block that promotes the schedule is irreversible, the schedule will become "active"
Parameters:
- producers - vector of producer keys
Returns:
an optional value of the version of the new proposed schedule if successful
function set_proposed_producers (2/2)
std::optional<uint64_t> eosio::set_proposed_producers(
const std::vector< producer_authority > & prods
)
Proposes a schedule change using the more flexible key format
Note:
Once the block that contains the proposal becomes irreversible, the schedule is promoted to "pending" automatically. Once the block that promotes the schedule is irreversible, the schedule will become "active"
Parameters:
- producers - vector of producer authorities
Returns:
an optional value of the version of the new proposed schedule if successful
function is_privileged
bool eosio::is_privileged(
name account
)
Check if an account is privileged
Parameters:
- account - name of the account to be checked
Returns:
true if the account is privileged
Returns:
false if the account is not privileged
function set_privileged
void eosio::set_privileged(
name account,
bool is_priv
)
Set the privileged status of an account
Parameters:
- account - name of the account whose privileged account to be set
- is_priv - privileged status
function preactivate_feature
void eosio::preactivate_feature(
const checksum256 & feature_digest
)
Pre-activate protocol feature
Parameters:
- feature_digest - digest of the protocol feature to pre-activate
function get_active_producers
std::vector<name> eosio::get_active_producers()
Returns back the list of active producer names.
function add_security_group_participants
int64_t eosio::add_security_group_participants(
const std::set< name > & participants
)
Propose new participants to the security group.
Parameters:
- participants - the participants.
Returns:
-1 if proposing a new security group was unsuccessful, otherwise returns 0.
function remove_security_group_participants
int64_t eosio::remove_security_group_participants(
const std::set< name > & participants
)
Propose to remove participants from the security group. å
Parameters:
- participants - the participants. å
Returns:
-1 if proposing a new security group was unsuccessful, otherwise returns 0.
function in_active_security_group
bool eosio::in_active_security_group(
const std::set< name > & participants
)
Check if the specified accounts are all in the active security group.
Parameters:
- participants - the participants.
Returns:
Returns true if the specified accounts are all in the active security group.
function get_active_security_group
security_group eosio::get_active_security_group()
Gets the active security group
Parameters:
- packed_security_group - the buffer containing the packed security_group.
Returns:
Returns the size required in the buffer (if the buffer is too small, nothing is written).
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.
** WARNING: this method will immediately abort execution of wasm code that is on the stack and would be executed as the method normally returned. Problems can occur with write-caches, RAII, reference counting when this method aborts execution of wasm code immediately. **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 send_deferred
void eosio::send_deferred(
const uint128_t & sender_id,
name payer,
const char * serialized_transaction,
size_t size,
bool replace = false
)
Send a deferred transaction
Parameters:
- sender_id - Account name of the sender of this deferred transaction
- payer - Account name responsible for paying the RAM for this deferred transaction
- serialized_transaction - The packed transaction to be deferred
- size - The size of the packed transaction, required for persistence.
- replace - If true, will replace an existing transaction.
function get_action
action eosio::get_action(
uint32_t type,
uint32_t index
)
Retrieve the indicated action from the active transaction.
Parameters:
- type - 0 for context free action, 1 for action
- index - the index of the requested action
Returns:
the indicated action
function read_transaction
size_t eosio::read_transaction(
char * ptr,
size_t sz
)
Access a copy of the currently executing transaction.
Access a copy of the currently executing transaction.
Returns:
the currently executing transaction
function cancel_deferred
int eosio::cancel_deferred(
const uint128_t & sender_id
)
Cancels a deferred transaction.
Parameters:
- sender_id - The id of the sender
Precondition:
The deferred transaction ID exists.
Precondition:
The deferred transaction ID has not yet been published.
Post
Deferred transaction canceled.
Returns:
1 if transaction was canceled, 0 if transaction was not found
Example:
id = 0xffffffffffffffff
cancel_deferred( id );
function transaction_size
size_t eosio::transaction_size()
Gets the size of the currently executing transaction.
Gets the size of the currently executing transaction.
Returns:
size of the currently executing transaction
function tapos_block_num
int eosio::tapos_block_num()
Gets the block number used for TAPOS on the currently executing transaction.
Gets the block number used for TAPOS on the currently executing transaction.
Returns:
block number used for TAPOS on the currently executing transaction Example:
int tbn = tapos_block_num();
function tapos_block_prefix
int eosio::tapos_block_prefix()
Gets the block prefix used for TAPOS on the currently executing transaction.
Gets the block prefix used for TAPOS on the currently executing transaction.
Returns:
block prefix used for TAPOS on the currently executing transaction Example:
int tbp = tapos_block_prefix();
function expiration
uint32_t eosio::expiration()
Gets the expiration of the currently executing transaction.
Gets the expiration of the currently executing transaction.
Returns:
expiration of the currently executing transaction in seconds since Unix epoch
function get_context_free_data
int eosio::get_context_free_data(
uint32_t index,
char * buff,
size_t size
)
Retrieve the signed_transaction.context_free_data[index].
Retrieve the signed_transaction.context_free_data[index].
Parameters:
- index - the index of the context_free_data entry to retrieve
- buff - output buff of the context_free_data entry
- size - amount of context_free_data[index] to retrieve into buff, 0 to report required size
Returns:
size copied, or context_free_data[index].size() if 0 passed for size, or -1 if index not valid
function write_decimal
char* eosio::write_decimal(
char * begin,
char * end,
bool dry_run,
uint64_t number,
uint8_t num_decimal_places,
bool negative
)
function check (1/7)
void eosio::check(
bool pred,
std::string_view msg
)
Assert if the predicate fails and use the supplied message. Example:
eosio::check(a == b, "a does not equal b");
function check (2/7)
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 (3/7)
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 (4/7)
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 (5/7)
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 (6/7)
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 (7/7)
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);
function current_context_contract
name eosio::current_context_contract()
function operator<< (1/21)
template<typename Stream, typename T>
datastream<Stream>& eosio::operator<<(
datastream< Stream > & ds,
const std::list< T > & l
)
Serialize an std::list into a stream
Parameters:
- ds - The stream to write
- opt - The value to serialize
Template parameters:
- Stream - Type of datastream buffer
Returns:
datastream
function operator>> (1/21)
template<typename Stream, typename T>
datastream<Stream>& eosio::operator>>(
datastream< Stream > & ds,
std::list< T > & l
)
Deserialize an std::list from a stream
Parameters:
- ds - The stream to read
- opt - The destination for deserialized value
Template parameters:
- Stream - Type of datastream buffer
Returns:
datastream
function operator<< (2/21)
template<typename Stream, typename T>
datastream<Stream>& eosio::operator<<(
datastream< Stream > & ds,
const std::deque< T > & d
)
Serialize an std::deque into a stream
Parameters:
- ds - The stream to write
- opt - The value to serialize
Template parameters:
- Stream - Type of datastream buffer
Returns:
datastream
function operator>> (2/21)
template<typename Stream, typename T>
datastream<Stream>& eosio::operator>>(
datastream< Stream > & ds,
std::deque< T > & d
)
Deserialize an std::deque from a stream
Parameters:
- ds - The stream to read
- opt - The destination for deserialized value
Template parameters:
- Stream - Type of datastream buffer
Returns:
datastream
function operator<< (3/21)
template<typename Stream, typename... Ts>
datastream<Stream>& eosio::operator<<(
datastream< Stream > & ds,
const std::variant< Ts... > & var
)
Serialize an std::variant into a stream
Parameters:
- ds - The stream to write
- opt - The value to serialize
Template parameters:
- Stream - Type of datastream buffer
Returns:
datastream
function deserialize
template<int I, typename Stream, typename... Ts>
void eosio::deserialize(
datastream< Stream > & ds,
std::variant< Ts... > & var,
int i
)
function operator>> (3/21)
template<typename Stream, typename... Ts>
datastream<Stream>& eosio::operator>>(
datastream< Stream > & ds,
std::variant< Ts... > & var
)
Deserialize an std::variant from a stream
Parameters:
- ds - The stream to read
- opt - The destination for deserialized value
Template parameters:
- Stream - Type of datastream buffer
Returns:
datastream
function operator<< (4/21)
template<typename Stream, typename T1, typename T2>
datastream<Stream>& eosio::operator<<(
datastream< Stream > & ds,
const std::pair< T1, T2 > & t
)
Serialize an std::pair
Parameters:
- ds - The stream to write
- t - The value to serialize
Template parameters:
- Stream - Type of datastream buffer
- Args - Type of the objects contained in the tuple
Returns:
datastream
function operator>> (4/21)
template<typename Stream, typename T1, typename T2>
datastream<Stream>& eosio::operator>>(
datastream< Stream > & ds,
std::pair< T1, T2 > & t
)
Deserialize an std::pair
Parameters:
- ds - The stream to read
- t - The destination for deserialized value
Template parameters:
- Stream - Type of datastream buffer
- Args - Type of the objects contained in the tuple
Returns:
datastream
function operator<< (5/21)
template<typename Stream, typename T>
datastream<Stream>& eosio::operator<<(
datastream< Stream > & ds,
const std::optional< T > & opt
)
Serialize an optional into a stream
Parameters:
- ds - The stream to write
- opt - The value to serialize
Template parameters:
- Stream - Type of datastream buffer
Returns:
datastream
function operator>> (5/21)
template<typename Stream, typename T>
datastream<Stream>& eosio::operator>>(
datastream< Stream > & ds,
std::optional< T > & opt
)
Deserialize an optional from a stream
Parameters:
- ds - The stream to read
- opt - The destination for deserialized value
Template parameters:
- Stream - Type of datastream buffer
Returns:
datastream
function operator<< (6/21)
template<typename Stream>
datastream<Stream>& eosio::operator<<(
datastream< Stream > & ds,
const bool & d
)
Serialize a bool into a stream
Parameters:
- ds - The stream to read
- d - The value to serialize
Template parameters:
- Stream - Type of datastream buffer
Returns:
datastream
function operator>> (6/21)
template<typename Stream>
datastream<Stream>& eosio::operator>>(
datastream< Stream > & ds,
bool & d
)
Deserialize a bool from a stream
Parameters:
- ds - The stream to read
- d - The destination for deserialized value
Template parameters:
- Stream - Type of datastream buffer
Returns:
datastream
function operator<< (7/21)
template<typename Stream>
datastream<Stream>& eosio::operator<<(
datastream< Stream > & ds,
const std::string & v
)
Serialize a string into a stream
Parameters:
- ds - The stream to write
- v - The value to serialize
Template parameters:
- Stream - Type of datastream buffer
Returns:
datastream
function operator>> (7/21)
template<typename Stream>
datastream<Stream>& eosio::operator>>(
datastream< Stream > & ds,
std::string & v
)
Deserialize a string from a stream
Parameters:
- ds - The stream to read
- v - The destination for deserialized value
Template parameters:
- Stream - Type of datastream buffer
Returns:
datastream
function operator<< (8/21)
template<typename Stream, typename T, std::size_t N>
datastream<Stream>& eosio::operator<<(
datastream< Stream > & ds,
const std::array< T, N > & v
)
Serialize a fixed size std::array
Parameters:
- ds - The stream to write
- v - The value to serialize
Template parameters:
- Stream - Type of datastream buffer
- T - Type of the object contained in the array
- N - Size of the array
Returns:
datastream
function operator>> (8/21)
template<typename Stream, typename T, std::size_t N>
datastream<Stream>& eosio::operator>>(
datastream< Stream > & ds,
std::array< T, N > & v
)
Deserialize a fixed size std::array
Parameters:
- ds - The stream to read
- v - The destination for deserialized value
Template parameters:
- Stream - Type of datastream buffer
- T - Type of the object contained in the array
- N - Size of the array
Returns:
datastream
function operator>> (9/21)
template<typename Stream, typename T, std::enable_if_t< _datastream_detail::is_pointer< T >()> *>
datastream<Stream>& eosio::operator>>(
datastream< Stream > & ds,
T
)
Pointer should not be serialized, so this function will always throws an error.
Deserialize a pointer
Parameters:
- ds - The stream to read
Template parameters:
- Stream - Type of datastream buffer
- T - Type of the pointer
Returns:
datastream
Post
Throw an exception if it is a pointer
function operator<< (9/21)
template<typename Stream, typename T, std::size_t N, std::enable_if_t<!_datastream_detail::is_primitive< T >() &&!_datastream_detail::is_pointer< T >()> *>
datastream< Stream > & eosio::operator<<(
datastream< Stream > & ds,
const T(&) v
)
Serialize a fixed size C array of non-primitive and non-pointer type
Parameters:
- ds - The stream to write
- v - The value to serialize
Template parameters:
- Stream - Type of datastream buffer
- T - Type of the pointer
Returns:
datastream
Serialize a fixed size C array of primitive type
Parameters:
- ds - The stream to write
- v - The value to serialize
Template parameters:
- Stream - Type of datastream buffer
- T - Type of the pointer
Returns:
datastream
function operator>> (10/21)
template<typename Stream, typename T, std::size_t N, std::enable_if_t<!_datastream_detail::is_primitive< T >() &&!_datastream_detail::is_pointer< T >()> *>
datastream< Stream > & eosio::operator>>(
datastream< Stream > & ds,
T(&) v
)
Deserialize a fixed size C array of non-primitive and non-pointer type
Parameters:
- ds - The stream to read
- v - The destination for deserialized value
Template parameters:
- T - Type of the object contained in the array
- N - Size of the array
- Stream - Type of datastream buffer
Returns:
datastream
Deserialize a fixed size C array of primitive type
Parameters:
- ds - The stream to read
- v - The destination for deserialized value
Template parameters:
- T - Type of the object contained in the array
- N - Size of the array
- Stream - Type of datastream buffer
Returns:
datastream
function operator<< (10/21)
template<typename Stream>
datastream<Stream>& eosio::operator<<(
datastream< Stream > & ds,
const std::vector< char > & v
)
Serialize a vector of char
Parameters:
- ds - The stream to write
- v - The value to serialize
Template parameters:
- Stream - Type of datastream buffer
Returns:
datastream
function operator<< (11/21)
template<typename Stream, typename T>
datastream<Stream>& eosio::operator<<(
datastream< Stream > & ds,
const std::vector< T > & v
)
Serialize a vector
Parameters:
- ds - The stream to write
- v - The value to serialize
Template parameters:
- Stream - Type of datastream buffer
- T - Type of the object contained in the vector
Returns:
datastream
function operator>> (11/21)
template<typename Stream>
datastream<Stream>& eosio::operator>>(
datastream< Stream > & ds,
std::vector< char > & v
)
Deserialize a vector of char
Parameters:
- ds - The stream to read
- v - The destination for deserialized value
Template parameters:
- Stream - Type of datastream buffer
Returns:
datastream
function operator>> (12/21)
template<typename Stream, typename T>
datastream<Stream>& eosio::operator>>(
datastream< Stream > & ds,
std::vector< T > & v
)
Deserialize a vector
Parameters:
- ds - The stream to read
- v - The destination for deserialized value
Template parameters:
- Stream - Type of datastream buffer
- T - Type of the object contained in the vector
Returns:
datastream
function operator<< (12/21)
template<typename Stream, typename T>
datastream<Stream>& eosio::operator<<(
datastream< Stream > & ds,
const std::set< T > & s
)
Serialize a set
Parameters:
- ds - The stream to write
- s - The value to serialize
Template parameters:
- Stream - Type of datastream buffer
- T - Type of the object contained in the set
Returns:
datastream
function operator>> (13/21)
template<typename Stream, typename T>
datastream<Stream>& eosio::operator>>(
datastream< Stream > & ds,
std::set< T > & s
)
Deserialize a set
Parameters:
- ds - The stream to read
- s - The destination for deserialized value
Template parameters:
- Stream - Type of datastream buffer
- T - Type of the object contained in the set
Returns:
datastream
function operator<< (13/21)
template<typename Stream, typename K, typename V>
datastream<Stream>& eosio::operator<<(
datastream< Stream > & ds,
const std::map< K, V > & m
)
Serialize a map
Parameters:
- ds - The stream to write
- m - The value to serialize
Template parameters:
- Stream - Type of datastream buffer
- K - Type of the key contained in the map
- V - Type of the value contained in the map
Returns:
datastream
function operator>> (14/21)
template<typename Stream, typename K, typename V>
datastream<Stream>& eosio::operator>>(
datastream< Stream > & ds,
std::map< K, V > & m
)
Deserialize a map
Parameters:
- ds - The stream to read
- m - The destination for deserialized value
Template parameters:
- Stream - Type of datastream buffer
- K - Type of the key contained in the map
- V - Type of the value contained in the map
Returns:
datastream
function operator<< (14/21)
template<typename Stream, typename... Args>
datastream<Stream>& eosio::operator<<(
datastream< Stream > & ds,
const std::tuple< Args... > & t
)
Serialize a tuple
Parameters:
- ds - The stream to write
- t - The value to serialize
Template parameters:
- Stream - Type of datastream buffer
- Args - Type of the objects contained in the tuple
Returns:
datastream
function operator>> (15/21)
template<typename Stream, typename... Args>
datastream<Stream>& eosio::operator>>(
datastream< Stream > & ds,
std::tuple< Args... > & t
)
Deserialize a tuple
Parameters:
- ds - The stream to read
- t - The destination for deserialized value
Template parameters:
- Stream - Type of datastream buffer
- Args - Type of the objects contained in the tuple
Returns:
datastream
function operator<< (15/21)
template<typename DataStream, typename T, std::enable_if_t< std::is_class< T >::value &&_datastream_detail::is_datastream< DataStream >::value > *>
DataStream& eosio::operator<<(
DataStream & ds,
const T & v
)
Serialize a class
Parameters:
- ds - The stream to write
- v - The value to serialize
Template parameters:
- DataStream - Type of datastream
- T - Type of class
Returns:
DataStream& - Reference to the datastream
function operator>> (16/21)
template<typename DataStream, typename T, std::enable_if_t< std::is_class< T >::value &&_datastream_detail::is_datastream< DataStream >::value > *>
DataStream& eosio::operator>>(
DataStream & ds,
T & v
)
Deserialize a class
Parameters:
- ds - The stream to read
- v - The destination for deserialized value
Template parameters:
- DataStream - Type of datastream
- T - Type of class
Returns:
DataStream& - Reference to the datastream
function operator<< (16/21)
template<typename Stream, typename T, std::enable_if_t< _datastream_detail::is_primitive< T >()> *>
datastream<Stream>& eosio::operator<<(
datastream< Stream > & ds,
const T & v
)
Serialize a primitive type
Parameters:
- ds - The stream to write
- v - The value to serialize
Template parameters:
- Stream - Type of datastream buffer
- T - Type of the primitive type
Returns:
datastream
function operator>> (17/21)
template<typename Stream, typename T, std::enable_if_t< _datastream_detail::is_primitive< T >()> *>
datastream<Stream>& eosio::operator>>(
datastream< Stream > & ds,
T & v
)
Deserialize a primitive type
Parameters:
- ds - The stream to read
- v - The destination for deserialized value
Template parameters:
- Stream - Type of datastream buffer
- T - Type of the primitive type
Returns:
datastream
function unpack (1/3)
template<typename T>
T eosio::unpack(
const char * buffer,
size_t len
)
Unpack data inside a fixed size buffer as T
Template parameters:
- T - Type of the unpacked data
Parameters:
- buffer - Pointer to the buffer
- len - Length of the buffer
Returns:
T - The unpacked data
function unpack (2/3)
template<typename T>
void eosio::unpack(
T & res,
const char * buffer,
size_t len
)
Unpack data inside a fixed size buffer as T
Template parameters:
- T - Type of the unpacked data
Parameters:
- res - Variable to fill with the unpacking
- buffer - Pointer to the buffer
- len - Length of the buffer
Returns:
T - The unpacked data
function unpack (3/3)
template<typename T>
T eosio::unpack(
const std::vector< char > & bytes
)
Unpack data inside a variable size buffer as T
Template parameters:
- T - Type of the unpacked data
Parameters:
- bytes - Buffer
Returns:
T - The unpacked data
function pack_size
template<typename T>
size_t eosio::pack_size(
const T & value
)
Get the size of the packed data
Template parameters:
- T - Type of the data to be packed
Parameters:
- value - Data to be packed
Returns:
size_t - Size of the packed data
function pack
template<typename T>
std::vector<char> eosio::pack(
const T & value
)
Get packed data
Template parameters:
- T - Type of the data to be packed
Parameters:
- value - Data to be packed
Returns:
bytes - The packed data
function operator<< (17/21)
template<typename DataStream, typename T>
DataStream& eosio::operator<<(
DataStream & ds,
const ::eosio::ignore_wrapper< T > & val
)
Serialize ignored_wrapper
Serialize an ignored_wrapper type into a stream
Parameters:
- ds - The stream to write
- val - The value to serialize
Template parameters:
- DataStream - Type of datastream buffer
Returns:
DataStream& - Reference to the datastream
function operator<< (18/21)
template<typename DataStream, typename T>
DataStream& eosio::operator<<(
DataStream & ds,
const ::eosio::ignore< T > & val
)
Serialize an ignored type.
Serialize an ignored type into a stream
Parameters:
- ds - The stream to write
- ignore - The value to serialize
Template parameters:
- DataStream - Type of datastream buffer
Returns:
DataStream& - Reference to the datastream
function operator>> (18/21)
template<typename DataStream, typename T>
DataStream& eosio::operator>>(
DataStream & ds,
::eosio::ignore< T > &
)
Deserialize an ignored type.
Deserialize an ignored type from a stream
Parameters:
- ds - The stream to read
- ignored - The destination for deserialized value
Template parameters:
- DataStream - Type of datastream buffer
Returns:
DataStream& - Reference to the datastream
function to_key (1/12)
template<typename T, typename S>
void eosio::to_key(
const T & obj,
datastream< S > & stream
)
function to_key_tuple
template<int I, typename T, typename S>
void eosio::to_key_tuple(
const T & obj,
datastream< S > & stream
)
function to_key (2/12)
template<typename... Ts, typename S>
void eosio::to_key(
const std::tuple< Ts... > & obj,
datastream< S > & stream
)
function to_key (3/12)
template<typename T, std::size_t N, typename S>
void eosio::to_key(
const std::array< T, N > & obj,
datastream< S > & stream
)
function to_key_optional (1/2)
template<typename T, typename S>
void eosio::to_key_optional(
const bool * obj,
datastream< S > & stream
)
function to_key_optional (2/2)
template<typename T, typename S>
void eosio::to_key_optional(
const T * obj,
datastream< S > & stream
)
function to_key (4/12)
template<typename T, typename U, typename S>
void eosio::to_key(
const std::pair< T, U > & obj,
datastream< S > & stream
)
function to_key_range
template<typename T, typename S>
void eosio::to_key_range(
const T & obj,
datastream< S > & stream
)
function to_key (5/12)
template<typename T, typename S>
auto eosio::to_key(
const T & obj,
datastream< S > & stream
)
function to_key (6/12)
template<typename T, typename U, typename S>
void eosio::to_key(
const std::map< T, U > & obj,
datastream< S > & stream
)
function to_key (7/12)
template<typename T, typename S>
void eosio::to_key(
const std::optional< T > & obj,
datastream< S > & stream
)
function to_key_varuint32
template<typename S>
void eosio::to_key_varuint32(
std::uint32_t obj,
datastream< S > & stream
)
function to_key_varint32
template<typename S>
void eosio::to_key_varint32(
std::int32_t obj,
datastream< S > & stream
)
function to_key (8/12)
template<typename... Ts, typename S>
void eosio::to_key(
const std::variant< Ts... > & obj,
datastream< S > & stream
)
function to_key (9/12)
template<std::size_t N, typename S>
void eosio::to_key(
const char(&) str,
datastream< S > & stream
)
function to_key (10/12)
template<typename S>
void eosio::to_key(
std::string_view obj,
datastream< S > & stream
)
function to_key (11/12)
template<typename S>
void eosio::to_key(
const std::string & obj,
datastream< S > & stream
)
function to_key (12/12)
template<typename S>
void eosio::to_key(
bool obj,
datastream< S > & stream
)
function float_to_key
template<typename UInt, typename T>
UInt eosio::float_to_key(
T value
)
function convert_to_key (1/2)
template<typename T>
void eosio::convert_to_key(
const T & t,
key_type & bin
)
function convert_to_key (2/2)
template<typename T>
key_type eosio::convert_to_key(
const T & t
)
function pow
template<uint8_t Base, typename T>
constexpr T eosio::pow(
uint8_t exponent
)
Returns:
Base^exponent
function printhex
void eosio::printhex(
const void * ptr,
uint32_t size
)
Prints hexidecimal data of length datalen.
Prints a block of bytes in hexadecimal
Parameters:
- ptr - pointer to bytes of interest
- size - number of bytes to print
function printl
void eosio::printl(
const char * ptr,
size_t len
)
Prints string to a given length
Parameters:
- ptr - a string
- len - number of chars to print
function print (1/7)
void eosio::print(
const char * ptr
)
Prints string
Parameters:
- ptr - a null terminated string
function print (2/7)
template<typename T, std::enable_if_t< std::is_integral< std::decay_t< T >>::value &&std::is_signed< std::decay_t< T >>::value, int >>
void eosio::print(
T num
)
Prints 8-128 bit signed integer
Parameters:
- num to be printed
Prints 8-128 bit unsigned integer
Parameters:
- num to be printed
function print (3/7)
void eosio::print(
float num
)
Prints single-precision floating point number (i.e. float)
Parameters:
- num to be printed
function print (4/7)
void eosio::print(
double num
)
Prints double-precision floating point number (i.e. double)
Parameters:
- num to be printed
function print (5/7)
void eosio::print(
long double num
)
Prints quadruple-precision floating point number (i.e. long double)
Parameters:
- num to be printed
function print (6/7)
template<typename T, std::enable_if_t<!std::is_integral< std::decay_t< T >>::value, int >>
void eosio::print(
T && t
)
Prints class object
Parameters:
- t to be printed
Precondition:
T must implements print() function
function print_f (1/2)
void eosio::print_f(
const char * s
)
Prints null terminated string
Parameters:
- s null terminated string to be printed
function print_f (2/2)
template<typename Arg, typename... Args>
void eosio::print_f(
const char * s,
Arg val,
Args... rest
)
Prints formatted string. It behaves similar to C printf/
Template parameters:
- Arg - Type of the value used to replace the format specifier
- Args - Type of the value used to replace the format specifier
Parameters:
- s - Null terminated string with to be printed (it can contains format specifier)
- val - The value used to replace the format specifier
- rest - The values used to replace the format specifier
Example:
print_f("Number of apples: %", 10);
function print (7/7)
template<typename Arg, typename... Args>
void eosio::print(
Arg && a,
Args &&... args
)
Print out value / list of values
Template parameters:
- Arg - Type of the value used to replace the format specifier
- Args - Type of the value used to replace the format specifier
Parameters:
- a - The value to be printed
- args - The other values to be printed
Example:
const char *s = "Hello World!";
uint64_t unsigned_64_bit_int = 1e+18;
uint128_t unsigned_128_bit_int (87654323456);
uint64_t string_as_unsigned_64_bit = "abcde"_n;
print(s , unsigned_64_bit_int, unsigned_128_bit_int, string_as_unsigned_64_bit);
// Ouput: Hello World!100000000000000000087654323456abcde
function overloaded (2/2)
template<class... Ts>
eosio::overloaded(
Ts...
)
function operator<
bool eosio::operator<(
const string & lhs,
const string & rhs
)
function operator>
bool eosio::operator>(
const string & lhs,
const string & rhs
)
function operator<=
bool eosio::operator<=(
const string & lhs,
const string & rhs
)
function operator>=
bool eosio::operator>=(
const string & lhs,
const string & rhs
)
function operator==
bool eosio::operator==(
const string & lhs,
const string & rhs
)
function operator!=
bool eosio::operator!=(
const string & lhs,
const string & rhs
)
function operator+
string eosio::operator+(
const string & lhs,
const string & rhs
)
function operator<< (19/21)
template<typename DataStream>
DataStream& eosio::operator<<(
DataStream & ds,
const string & str
)
function operator>> (19/21)
template<typename DataStream>
DataStream& eosio::operator>>(
DataStream & ds,
string & str
)
function operator<< (20/21)
template<typename DataStream>
DataStream& eosio::operator<<(
DataStream & ds,
const eosio::symbol_code sym_code
)
Serialize a symbol_code into a stream
Parameters:
- ds - The stream to write
- sym - The value to serialize
Template parameters:
- DataStream - Type of datastream buffer
Returns:
DataStream& - Reference to the datastream
function operator>> (20/21)
template<typename DataStream>
DataStream& eosio::operator>>(
DataStream & ds,
eosio::symbol_code & sym_code
)
Deserialize a symbol_code from a stream
Parameters:
- ds - The stream to read
- symbol - The destination for deserialized value
Template parameters:
- DataStream - Type of datastream buffer
Returns:
DataStream& - Reference to the datastream
function operator<< (21/21)
template<typename DataStream>
DataStream& eosio::operator<<(
DataStream & ds,
const eosio::symbol sym
)
Serialize a symbol.
Serialize a symbol into a stream
Parameters:
- ds - The stream to write
- sym - The value to serialize
Template parameters:
- DataStream - Type of datastream buffer
Returns:
DataStream& - Reference to the datastream
function operator>> (21/21)
template<typename DataStream>
DataStream& eosio::operator>>(
DataStream & ds,
eosio::symbol & sym
)
Deserialize a symbol.
Deserialize a symbol from a stream
Parameters:
- ds - The stream to read
- symbol - The destination for deserialized value
Template parameters:
- DataStream - Type of datastream buffer
Returns:
DataStream& - Reference to the datastream
function seconds
microseconds eosio::seconds(
int64_t s
)
function milliseconds
microseconds eosio::milliseconds(
int64_t s
)
function minutes
microseconds eosio::minutes(
int64_t m
)
function hours
microseconds eosio::hours(
int64_t h
)
function days
microseconds eosio::days(
int64_t d
)
The documentation for this class was generated from the following file: libraries/eosiolib/contracts/eosio/action.hpp