Platform: Code4rena
Start Date: 29/03/2022
Pot Size: $50,000 USDC
Total HM: 16
Participants: 42
Period: 5 days
Judge: 0xean
Total Solo HM: 9
Id: 105
League: ETH
Rank: 5/42
Findings: 2
Award: $4,151.74
🌟 Selected for report: 2
🚀 Solo Findings: 2
🌟 Selected for report: hubble
2075.8711 USDC - $2,075.87
Function cooldown() is not protected when protocol is in emergency mode. Its behavior is not consistent with the other major functions defined.
While other major functions like stake, unstake, lock, unlock, etc., of this contract is protected by checking for emergency flag and reverting, this function cooldown() is not checked. The impact of this is that during emergency mode, users can set immediately the cooldown() and plan for unstaking when the emergency mode is lifted and cooldown period expires. This may not be the desirable behaviour expected by the protocol.
Contract Name : HolyPaladinToken.sol Function cooldown()
Add checking for emergency mode for this function also.
if(emergency) revert EmergencyBlock();
#0 - Kogaroshi
2022-04-02T21:18:13Z
Changes made in: https://github.com/PaladinFinance/Paladin-Tokenomics/pull/10
🌟 Selected for report: hubble
2075.8711 USDC - $2,075.87
When the contract is in blocked state (emergency mode), the protocol wants to return an empty UserLock info, on calling the function getUserLock. However, there is another way, by which the users can find the same information.
The below function is not protected when in emergency mode, and users can use this alternatively. Line#466 function getUserPastLock(address user, uint256 blockNumber)
There is no loss of funds, however the intention to block information (return empty lock info) is defeated, because not all functions are protected. There is inconsistency in implementing the emergency mode check.
Contract Name : HolyPaladinToken.sol Functions getUserLock and getUserPastLock
Add checking for emergency mode for this function getUserPastLock.
if(emergency) revert EmergencyBlock();
Additional user access check can be added, so that the function returns correct value when the caller(msg.sender) is admin or owner.
#0 - Kogaroshi
2022-04-04T13:09:17Z
Instead of reverting the call, we return an empty Lock (as for getUserLock()
)
Changes in the PR: https://github.com/PaladinFinance/Paladin-Tokenomics/pull/13