Skip to content

fix(learn-token): enforce require_not_paused in create_vesting (#499) - #515

Open
lmduy2612 wants to merge 1 commit into
ChainLearnOfficial:mainfrom
lmduy2612:fix/create-vesting-pause-check-499
Open

lmduy2612 wants to merge 1 commit into
ChainLearnOfficial:mainfrom
lmduy2612:fix/create-vesting-pause-check-499

Conversation

@lmduy2612

Copy link
Copy Markdown

Summary of Changes

Enforces the emergency pause check in create_vesting within the LearnToken contract as specified in #499.

Previously, create_vesting did not check the pause state, allowing new vesting schedules to be created during an emergency pause while claim_vested already enforced Self::require_not_paused(&env).

Verification & Testing

  • Added test_create_vesting_fails_while_paused in tests/unit/token_tests.rs verifying that calling create_vesting while paused reverts with "contract is paused".
  • Added test_create_vesting_allowed_after_unpause verifying that vesting creation succeeds once unpaused.
  • All 80 unit tests pass in cargo test --test token_tests.
  • All 4 tests in tests/integration/emergency_pause_flow.rs pass.

Closes #499

- Add Self::require_not_paused(&env) check to create_vesting before admin authorization
- Add unit tests verifying create_vesting panics when contract is paused and succeeds upon unpause
- Clean up test sequence numbers and assertions in token_tests.rs

Closes ChainLearnOfficial#499
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.

create_vesting bypasses pause state check in learn-token

2 participants