-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Account price based on rem.oracle #127
Conversation
- account price 0.5 $ in token
rem.oracle
723ed51
to
3453220
Compare
…re/account_price_based_on_oracle
…mmeauth/remprotocol into feature/account_price_based_on_oracle
* fixed tests * move min_account_price from table to code * move account creation fee code to the get_min_account_stake
uint64_t system_contract::get_min_account_stake() { | ||
eosio::remprice_idx remprice_table(oracle_account, oracle_account.value); | ||
auto it = remprice_table.find(rem_usd_pair.value); | ||
bool is_valid_price = (it != remprice_table.end()) && ((current_time_point() - it->last_update.to_time_point()) <= eosio::minutes(70)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
70 minutes should be parametrized, let's avoid magic numbers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roman-tik, done.
auto it = remprice_table.find(rem_usd_pair.value); | ||
bool is_valid_price = (it != remprice_table.end()) && ((current_time_point() - it->last_update.to_time_point()) <= eosio::minutes(70)); | ||
|
||
return is_valid_price ? std::min(uint64_t(min_account_price / it->price), _gstate.min_account_stake) : _gstate.min_account_stake; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sure uint64_t(min_account_price / it->price) != 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roman-tik, done.
73bf797
to
dbdd40d
Compare
Change Description
Consensus Changes
API Changes
Documentation Additions