-
Notifications
You must be signed in to change notification settings - Fork 82
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
feat(contracts): apply audit results about vesting wallet #342
Conversation
WalkthroughThe recent update introduces a new test function to the Changes
Sequence Diagram(s)sequenceDiagram
participant Tester as KromaVestingWalletTest
participant Wallet as KromaVestingWallet
Tester->>+Wallet: initialize(_beneficiary, _startTimestamp, _durationSeconds)
alt _durationSeconds not multiple of VESTING_CYCLE
Wallet-->>-Tester: revert()
else _durationSeconds is valid
Wallet-->>-Tester: initialize successfully
end
sequenceDiagram
participant Tester as KromaVestingWalletTest
participant Wallet as KromaVestingWallet
Tester->>Wallet: release(timestamp)
alt timestamp >= start() + duration()
Wallet-->>Tester: release tokens
else timestamp < start() + duration()
Wallet-->>Tester: revert()
end
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- packages/contracts/.gas-snapshot (1 hunks)
- packages/contracts/contracts/test/KromaVestingWallet.t.sol (1 hunks)
- packages/contracts/contracts/universal/KromaVestingWallet.sol (2 hunks)
Additional comments not posted (12)
packages/contracts/contracts/universal/KromaVestingWallet.sol (2)
62-65
: LGTM! The duration check ensures integrity.The added check ensures that
_durationSeconds
is a multiple ofVESTING_CYCLE
, which is crucial for the vesting schedule integrity.
102-102
: LGTM! Correct change to ensure full vesting.Changing the condition to
>=
ensures that the full amount is vested when the timestamp is exactly at the end of the duration.packages/contracts/contracts/test/KromaVestingWallet.t.sol (1)
79-89
: LGTM! Comprehensive test for duration check.The new test function correctly verifies that the initialization reverts when the duration is not a multiple of the vesting cycle.
packages/contracts/.gas-snapshot (9)
167-167
: LGTM! Updated gas cost fortest_constructor_succeeds
.The updated gas cost for
test_constructor_succeeds
is accurately reflected.
168-168
: LGTM! Updated gas cost fortest_constructor_zeroValues_reverts
.The updated gas cost for
test_constructor_zeroValues_reverts
is accurately reflected.
169-169
: LGTM! Added gas cost fortest_initialize_durationNotMultiple_reverts
.The added gas cost for
test_initialize_durationNotMultiple_reverts
is accurately reflected.
170-170
: LGTM! Updated gas cost fortest_initialize_succeeds
.The updated gas cost for
test_initialize_succeeds
is accurately reflected.
171-171
: LGTM! Updated gas cost fortest_release_afterFullyVested_succeeds
.The updated gas cost for
test_release_afterFullyVested_succeeds
is accurately reflected.
172-172
: LGTM! Updated gas cost fortest_release_notBeneficiary_reverts
.The updated gas cost for
test_release_notBeneficiary_reverts
is accurately reflected.
173-173
: LGTM! Updated gas cost fortest_release_succeeds
.The updated gas cost for
test_release_succeeds
is accurately reflected.
174-174
: LGTM! Updated gas cost fortest_release_tokenAfterFullyVested_succeeds
.The updated gas cost for
test_release_tokenAfterFullyVested_succeeds
is accurately reflected.
175-175
: LGTM! Updated gas cost fortest_release_token_succeeds
.The updated gas cost for
test_release_token_succeeds
is accurately reflected.
No description provided.