Closed DimaKovalenko17 closed 1 year ago
Actually, there is a front-running problem in the external transaction of any contract, but whether there is an attack depends on the specific function. About the stake and unstake functions, there are no issues with front-running attacks.
Same to 1, it depends on the specific function. According to our assessment, there are no issues with reentrancy attacks.
In actual use, the length of these two arrays is very limited, and there will be no gas problem.
This is my 4th attempt to find bugs, well it's impossible to find, I can't find any vulnerabilities.
Potential for Front-Running: The stake and unstake functions could potentially be susceptible to front-running attacks, where an attacker sees a transaction in the pending pool and issues their own transaction with a higher gas price to get it processed first.
Reentrancy: The code does not seem to have reentrancy guards in place. If a function calls an external contract (like IStakePool(_poolAddress).withdrawForStaker(...) ) and then continues execution, the external contract could call back into the original contract and change state before the first function finishes. This can lead to unexpected behavior.
Gas Usage: The newEra() function loops over potentially large arrays ( poolList and validators ). This could cause the function to exceed the block gas limit if these arrays are too large, making the function unable to complete its execution.
The code does not have a function to update the protocolFeeCommission, rateChangeLimit, unbondingDuration and other such parameters. This could be a problem if you want to update these values in the future.
// ------ delegation balancer
}