-
Notifications
You must be signed in to change notification settings - Fork 4
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
Use the previous weighted spot price instead of the current weighted spot price for addLiquidity
#1058
Conversation
Pull Request Test Coverage Report for Build 9554965756Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9554961305Details
💛 - Coveralls |
Hyperdrive Gas Benchmark
This comment was automatically generated by workflow using github-action-benchmark. |
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.
🤘
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.
just some nits
5f54d5c
to
9a49cd4
Compare
Pull Request Test Coverage Report for Build 9556661001Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9556686918Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9556687808Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9556689438Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9556718283Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9556729015Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9556728706Details
💛 - Coveralls |
… in the current checkpoint
…ed during checkpoints
* Simplified the checkpoint accounting * Caches the result of `_effectiveSharePrice()` in more places (#1060)
9a49cd4
to
7673da3
Compare
Pull Request Test Coverage Report for Build 9557401375Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9570423024Details
💛 - Coveralls |
Resolved Issues
Fixes: https://github.com/spearbit-audits/delv-week-review/issues/13
Description
This PR adds some tests to make sure that the weighted spot price behaves as expected with instantaneous trades and fixes an oversight where the current weighted spot price is used for the
addLiquidity
check instead of the previous weighted spot price.The previous weighted spot price will never be
0
inaddLiquidity
because the current checkpoint is always minted with_applyCheckpoint
. In_applyCheckpoint
, we always update the previous weighted spot price. This uses the current spot price for the update, so unless the current spot price is0
, the weighted spot price will be non-zero. Some tests were added to clarify this.Review Checklists
Please check each item before approving the pull request. While going
through the checklist, it is recommended to leave comments on items that are
referenced in the checklist to make sure that they are reviewed. If there are
multiple reviewers, copy the checklists into sections titled
## [Reviewer Name]
.If the PR doesn't touch Solidity, the corresponding checklist can
be removed.
@mcclurejt
approve
calls useforceApprove
?transfer
calls usesafeTransfer
?transferFrom
calls usemsg.sender
as thefrom
address?token spend?
call
,delegatecall
,staticcall
,transfer
,send
)success
boolean checked to handle failed calls?delegatecall
, are there strict access controls on theaddresses that can be called? It shouldn't be possible to
delegatecall
arbitrary addresses, so the list of possible targets should either be
immutable or tightly controlled by an admin.
nonReentrant
?not a concern or how it's mitigated?
memory variables?
issues?
payable
functions restricted to avoid stuck ether?catch underflows?
Safe
functions are altered, are potential underflows andoverflows caught so that a failure flag can be thrown?
covering the full input space?