QA Report #103
Labels
bug
Something isn't working
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
It would be great to emit an event before or after updating sensitive variables to make easy to track updates by community.
VE3Token.sol/setOperator()
VeTokenMinter.sol / addOperator()
VeTokenMinter.sol / removeOperator()
VE3DRewardPool.sol / addOperator()
VE3DRewardPool.sol / removeOperator()
RewardFactory.sol / addOperator()
RewardFactory.sol / removeOperator()
RewardFactory.sol / setAccess()
StashFactory / addOperator()
StashFactory / removeOperator()
Recommendation
Emit events before or after updating sensitive varaibles.
safeApprove() function of Openzeppelin’s ERC20 have been depreciated.
OpenZeppelin/openzeppelin-contracts#2268
OpenZeppelin/openzeppelin-contracts#2219
https://github.com/code-423n4/2022-05-vetoken/blob/main/contracts/VE3DRewardPool.sol#L287
https://github.com/code-423n4/2022-05-vetoken/blob/main/contracts/VE3DRewardPool.sol#L288
https://github.com/code-423n4/2022-05-vetoken/blob/main/contracts/VE3DRewardPool.sol#L301
https://github.com/code-423n4/2022-05-vetoken/blob/main/contracts/VE3DRewardPool.sol#L305
https://github.com/code-423n4/2022-05-vetoken/blob/main/contracts/Booster.sol#L374
Recommendation:
Use
safeIncreaseAllowance
orsafeDecreaseAllowance
functions instead.maxTime
ofVeAssetDepositor
should bepublic
Now, the
maxTime
ofVeAssetDepositor.sol
has been declared as aprivate
, but I think this should bepublic
.Recommendation:
Check this variable again.
stakeFor
function ofVE3DRewardPool.sol
contract.https://github.com/code-423n4/2022-05-vetoken/blob/main/contracts/VE3DRewardPool.sol#L249
In this line, the
msg.sender
is aVeAssetDepositor.sol
contract or any other address which is different from user’s address.Recommendation:
Emit event with actual user’s address.
Booster.sol
can be implemented by using OZ contracts.owner
variable andsetOwner
function, this can be implemented by inheriting OpenZeppelinOwnable
contract.isShutdown
variable andshutdownSystem
function, this can be implemented by inheriting OpenZeppelinPausable
contract.setRewardContracts
ofBooster.sol
function could emit event without changes.setRewardContracts
set values only iflockRewards
is address(0), but event is emitted per each function call.So if we use subgraph or anything else, it could lead to track wrong data.
Recommendation:
Emit
RewardcontractsUpdated
event inside condition.ITokenFactory
is an interface ofTokenFactory
contract. HoweverTokenFactory
did not inheritITokenFactory
. This lead unexpected issue – ex. Interface has function, but implementation contract did not implement it.IRewardFactory
andRewardFactory
are same case.Recommendation:
Inherit interfaces, and override functions to avoid any unexpected issues in the future.
The text was updated successfully, but these errors were encountered: