-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix(acurator): add more check for AssetIssueActuator #6525
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
base: release_v4.8.1
Are you sure you want to change the base?
fix(acurator): add more check for AssetIssueActuator #6525
Conversation
| // make sure FrozenSupply.expireTime not overflow | ||
| if (chainBaseManager.getForkController().pass(ForkBlockVersionEnum.VERSION_4_8_1) | ||
| && assetIssueContract.getStartTime() | ||
| >= Long.MAX_VALUE - next.getFrozenDays() * FROZEN_PERIOD) { |
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.
what about using > instead of '>=' and making the codes more readable, such as:
if (chainBaseManager.getForkController().pass(ForkBlockVersionEnum.VERSION_4_8_1)) {
long frozenPeriod = next.getFrozenDays() * FROZEN_PERIOD;
if (assetIssueContract.getStartTime() > Long.MAX_VALUE - frozenPeriod) {
throw new ContractValidateException(
"Start time and frozen days would cause expire time overflow");
}
}
|
|
||
| message FrozenSupply { | ||
| int64 frozen_amount = 1; | ||
| int64 frozen_amount = 1; //asset amount |
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.
add blank after '//', --> // asset amount
| int64 total_supply = 4; | ||
| repeated FrozenSupply frozen_supply = 5; | ||
| int32 trx_num = 6; | ||
| int32 trx_num = 6; // The fields trx_num and num are only used to calculate price and avoid usage of decimal, asset price = trx_num / num |
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.
Using // The fields trx_num and num define the exchange rate: num tokens can be purchased with trx_num TRX. This avoids using decimals. Example: trx_num=1, num=100 means 1 TRX buys 100 tokens. ?
What does this PR do?
Why are these changes required?
This PR has been tested by:
Follow up
Extra details