Create setschedule, delschedule, execschedule, setpayfactor ACTION & schedules TABLE to allow for the scheduling of system annual inflation rate changes to be executed at a future time.
Feedback provided by
@DenisCarriere
@nsjames
setschedule ACTION
/**
* Set the schedule for pre-determined annual rate changes.
*
* @param start_time - the time to start the schedule.
* @param annual_rate - the annual inflation rate of the core token supply.
* (eg. For 5% Annual inflation => annual_rate=500
* For 1.5% Annual inflation => annual_rate=150
*/
[[eosio::action]]
void setschedule( const time_point_sec start_time, int64_t annual_rate );
delschedule ACTION
/**
* Delete the schedule for pre-determined annual rate changes.
*
* @param start_time - the time to start the schedule.
*/
[[eosio::action]]
void delschedule( const time_point_sec start_time );
execschedule ACTION
/**
* Executes the next schedule for pre-determined annual rate changes.
*
* Start time of the schedule must be in the past.
*
* Can be executed by any account.
*/
void execschedule();
setpayfactor ACTION
/**
* Change how inflated or vested tokens will be distributed based on the following structure.
*
* @param inflation_pay_factor - Inverse of the fraction of the inflation used to reward block producers.
* The remaining inflation will be sent to the `eosio.saving` account.
* (eg. For 20% of inflation going to block producer rewards => inflation_pay_factor = 50000
* For 100% of inflation going to block producer rewards => inflation_pay_factor = 10000).
* @param votepay_factor - Inverse of the fraction of the block producer rewards to be distributed proportional to blocks produced.
* The remaining rewards will be distributed proportional to votes received.
* (eg. For 25% of block producer rewards going towards block pay => votepay_factor = 40000
* For 75% of block producer rewards going towards block pay => votepay_factor = 13333).
*/
[[eosio::action]]
void setpayfactor( int64_t inflation_pay_factor, int64_t votepay_factor );
Purpose
Create
setschedule
,delschedule
,execschedule
,setpayfactor
ACTION &schedules
TABLE to allow for the scheduling of system annual inflation rate changes to be executed at a future time.Feedback provided by
setschedule
ACTIONdelschedule
ACTIONexecschedule
ACTIONsetpayfactor
ACTIONschedules
TABLEPreconditions
require_auth(get_self())
start_time
must be in the future~start_time
is used as the primary key, overrides existing row if it existsannual_rate
cannot be negative value (0 or higher)claimrewards
will trigger the inflation rate change if thestart_time
has passedschedules
tableexecschedule
can be executed by any accountReferences
setinflation
claimrewards