Skip to content

Conversation

@317787106
Copy link
Contributor

What does this PR do?

Why are these changes required?

This PR has been tested by:

  • Unit Tests
  • Manual Testing

Follow up

Extra details

@317787106 317787106 changed the title hotfix(acurator): add more check for AssetIssueActuator fix(acurator): add more check for AssetIssueActuator Jan 26, 2026
// make sure FrozenSupply.expireTime not overflow
if (chainBaseManager.getForkController().pass(ForkBlockVersionEnum.VERSION_4_8_1)
&& assetIssueContract.getStartTime()
>= Long.MAX_VALUE - next.getFrozenDays() * FROZEN_PERIOD) {
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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. ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants