This repository has been archived by the owner on May 5, 2024. It is now read-only.
Beosin - Algorithm error #14
Labels
Excluded
Excluded by the judge without consulting the protocol or the senior
Non-Reward
This issue will not receive a payout
Beosin
medium
Algorithm error
##Summary
Inconsistency in calculations related to the HEAL_PROBABILITY_MINUEND parameter
##Vulnerability Detail
Inconsistency between the parameters used in the initialization HEAL_PROBABILITY_MINUEND and subsequent calculations in the healProbability function.
The algorithm for calculating HEAL_PROBABILITY_MINUEND is *99-80. the calculation in HEALProbability is *19 (which is 99-80) .
##Impact
The result of the healProbability function calculation is large, affecting the token destruction in _healRequestFulfilled, and the return value deadAgentsCount is not increased. The end of the game was delayed.
##Code Snippet
https://github.com/sherlock-audit/2023-10-looksrare/blob/main/contracts-infiltration/contracts/Infiltration.sol#L379-L381
https://github.com/sherlock-audit/2023-10-looksrare/blob/main/contracts-infiltration/contracts/Infiltration.sol#L1019-L1028
##Tool used
Manual Review
##Recommendation
It is recommended to modify the HEAL_PROBABILITY_MINUEND parameter or the calculation in the healProbability function.
The text was updated successfully, but these errors were encountered: