Skip to content
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

Add `require_auth` to `newperiod` action #6

Closed
DenisCarriere opened this issue May 11, 2019 · 1 comment

Comments

Projects
None yet
1 participant
@DenisCarriere
Copy link
Member

commented May 11, 2019

image

@DenisCarriere DenisCarriere added this to the v1 milestone May 11, 2019

@DenisCarriere DenisCarriere self-assigned this May 11, 2019

@DenisCarriere

This comment has been minimized.

Copy link
Member Author

commented May 11, 2019

void auditor::assertPeriodTime() {
    uint32_t timestamp = now();
    uint32_t periodBlockCount = timestamp - _currentState.lastperiodtime;
    eosio_assert(periodBlockCount > configs().auditor_tenure,
                 "ERR::NEWTENURE_EARLY::New period is being called too soon. Wait until the period has completed.");
}

https://github.com/EOS-Nation/auditor.bos/blob/master/src/newtenure_components.cpp#L1-L6

After the first newtenure is called, the next newtenure can only be called after the auditor_tenure period is over (+90 days).

No need to include require_auth since the new period can only be called after 3 months and cannot be executed earlier.

@SheldonHH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.