Closed DimaKovalenko17 closed 1 year ago
There is no need to check the input parameters of these get methods, and it has no effect on the function.
The init function will only be called once, the event is not necessary and can be omitted.
The require function can check the initialization conditions. So no need to use revert.
Before the contract function is used, the migrate function will be called, where the latestEra and rate variables will be set. So we believe there will be no problems.
These can help to check the accurate rToken supply and protocol fee conveniently, without any impact on the contract function.
Good afternoon, I found a couple of vulnerabilities in the code and bugs. This is my 3rd attempt to find bugs in the code and errors, I found some amount, maybe the code can be improved
My wallet - 0x9d06f88DF84a3A0dc04AfE8fD0a92A7f36BbBe35 1-2-3 errors, there are in the code, Below is the complete code
The getUnstakeIndexListOf function does not check values for _staker There is no event emission. The init function does not emit any events for the user No error handling. The init function does not revert if the initialization conditions are not met Non-identical variables: The latestEra and rate variables may cause unexpected behavior if they are used before they are set in contracts Unused variables: totalRTokenSupply and totalProtocolFee are declared but not used in the contract.
no input validation getValidatorldsOf does not validate the input value _poolAddress
No validation of input data. The getvBondedPools function does not check the input value bondedPools.lenght.
Lack of input data validation. The getRate function does not check input rate values
It does not check _rTokenDdress and _unbondingDuration values.
_unbondingDuration) public { require(admin == address(0), "already init"); require(_rTokenAddress != address(0), "zero rtoken address"); require(_erc20TokenAddress != address(0), "zero token address"); require(_unbondingDuration <= MAX_UNBONDING_DURATION, "max unbonding duration limit");