-
Notifications
You must be signed in to change notification settings - Fork 106
PerpV2LeverageModule Audit Fixes #177
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
Conversation
…alled from #trade
I'm struggling to come up with a better name right now but |
…teExternalPositionUnit
import { UnitConversionUtils } from "../../lib/UnitConversionUtils.sol"; | ||
|
||
/** | ||
* @title PerpLeverageModule |
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.
Small nit I just realized PerpV2LeverageModule
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.
Internal Audit
Miscellaneous
Structs
isBuy
229f2c4Events
Variables
internal
17fb7caFunctions
Constructor
trade
removeModule
moduleIssueHook
moduleRedeemHook
getIssuanceAdjustments
getRedemptionAdjustments
getPositionNotionalInfo
positions[_setToken][i]
into a variable 5c6ba08getPositionUnitInfo
positions[_setToken][i]
into a variable 5c6ba08_createAndValidateActionInfo
_createAndValidateActionInfoNotional
_updatePositionList
positionList.contains(_baseToken)
in variable and reuse 2596d7b_executeModuleIssuanceHook
_executeModuleRedemptionHook
_getReducedOpenNotional
_formatX96ToX10_18
ether 1
4d08b58Iosiro
5.1.1 Liquidations can prevent issuing and redeeming
5.1.2 Invalid state after liquidation
5.2.1 Unexpected reverts when querying TWAP oracle
Missing Natspec
Code layout
The code layout in the PerpV2LeverageModule could be improved through the following refactors:
Spelling and grammar
....