require nextId to be zero will always revert due to nextId already initialized to 1 #143
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
edited-by-warden
🤖_primary
AI based primary recommendation
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/ronin-chain/katana-v3-contracts/blob/03c80179e04f40d96f06c451ea494bb18f2a58fc/src/periphery/NonfungiblePositionManager.sol#L104
Vulnerability details
In NonfungiblePositionManager.sol there will be a problem initializing.
https://github.com/ronin-chain/katana-v3-contracts/blob/03c80179e04f40d96f06c451ea494bb18f2a58fc/src/periphery/NonfungiblePositionManager.sol#L83
_nextId is initialized to 1 in state variable declaration
https://github.com/ronin-chain/katana-v3-contracts/blob/03c80179e04f40d96f06c451ea494bb18f2a58fc/src/periphery/NonfungiblePositionManager.sol#L104
Initialize function checks if it's 0
This means that the check will always fail to initialize
Recommended Mitigation Steps
Chnage the require statement to check for _nextId == 1
Assessed type
Error
The text was updated successfully, but these errors were encountered: