Closed DenisCarriere closed 4 months ago
Methods to expose if REX is available or not.
Needed for contracts that want to implement donatetorex action which require REX to be active.
donatetorex
static bool rex_system_initialized() { eosiosystem::rex_pool_table _rexpool( "eosio"_n, "eosio"_n.value ); return _rexpool.begin() != _rexpool.end(); } static bool rex_available() { eosiosystem::rex_pool_table _rexpool( "eosio"_n, "eosio"_n.value ); return rex_system_initialized() && _rexpool.begin()->total_rex.amount > 0; }
if (rex_available()) { eosiosystem::system_contract::donatetorex_action donatetorex( "eosio"_n, { get_self(), "active"_n }); donatetorex.send(get_self(), quantity, memo); }
Implemented via https://github.com/AntelopeIO/reference-contracts/pull/70
Methods to expose if REX is available or not.
Needed for contracts that want to implement
donatetorex
action which require REX to be active.Example code