Platform: Code4rena
Start Date: 23/05/2022
Pot Size: $75,000 USDC
Total HM: 23
Participants: 75
Period: 7 days
Judge: GalloDaSballo
Total Solo HM: 13
Id: 130
League: ETH
Rank: 19/75
Findings: 2
Award: $456.13
๐ Selected for report: 0
๐ Solo Findings: 0
๐ Selected for report: unforgiven
Also found by: csanuragjain, p_crypt0, smiling_heretic
https://github.com/code-423n4/2022-05-velodrome/blob/7fda97c570b758bbfa7dd6724a336c43d4041740/contracts/contracts/Gauge.sol#L173-L186 https://github.com/code-423n4/2022-05-velodrome/blob/7fda97c570b758bbfa7dd6724a336c43d4041740/contracts/contracts/Bribe.sol#L83-L90
Funds drain from Bribe prematurely with repeated calls to deliverBribes()
Calling deliverBribes()
calls deliverRewards()
which transfers the amount
specified as the rewards due and sends to gauge.
Repeated calls to deliverBribes()
makes repeated calls to deliverRewards()
with the same amount
, since the rewards do not decrease to 0 within the epoch (they reset to 0 when epoch changes).
Add check to make sure repeated calls can't take place within a set time-zone.
#0 - pooltypes
2022-06-13T16:00:26Z
Duplicate of #141
#1 - GalloDaSballo
2022-07-01T01:11:56Z
Dup of #141
๐ Selected for report: IllIllI
Also found by: 0x1f8b, 0x52, 0xNazgul, 0xNineDec, AlleyCat, BouSalman, CertoraInc, Chom, Dravee, Funen, GimelSec, Hawkeye, MaratCerby, Nethermind, Picodes, RoiEvenHaim, SooYa, TerrierLover, WatchPug, _Adam, asutorufos, berndartmueller, c3phas, catchup, cccz, cryptphi, csanuragjain, delfin454000, djxploit, fatherOfBlocks, gzeon, hake, hansfriese, horsefacts, hyh, jayjonah8, minhquanym, oyc_109, p_crypt0, pauliax, robee, rotcivegaf, sach1r0, sashik_eth, simon135, sorrynotsorry, teddav, unforgiven, xiaoming90
102.2071 USDC - $102.21
Inconsistent declaration of parameter names in IVELO.sol:
pragma solidity 0.8.13; interface IVelo { function approve(address spender, uint value) external returns (bool); function mint(address, uint) external; function mintToRedemptionReceiver(uint) external returns (bool); function totalSupply() external view returns (uint); function balanceOf(address) external view returns (uint); function transfer(address, uint) external returns (bool); function transferFrom(address,address,uint) external returns (bool); }
Should read:
pragma solidity 0.8.13; interface IVelo { function approve(address spender, uint value) external returns (bool); function mint(address account, uint amount) external; function mintToRedemptionReceiver(uint amount) external returns (bool); function totalSupply() external view returns (uint); function balanceOf(address wallet) external view returns (uint); function transfer(address _to, uint _value) external returns (bool); function transferFrom(address _from, address _to, uint _value) external returns (bool); }
Add an extra bracket for clarity:
uint bribeStart = timestamp - (timestamp % (7 days)) + BRIBE_LAG;
Would read better as:
uint bribeStart = (timestamp - (timestamp % (7 days))) + BRIBE_LAG;
Add an extra bracket for clarity:
uint bribeEnd = bribeStart + DURATION - COOLDOWN;
Would read better as:
uint bribeEnd = (bribeStart + DURATION) - COOLDOWN;
Velo.sol should implement IVELO interface https://github.com/code-423n4/2022-05-velodrome/blob/7fda97c570b758bbfa7dd6724a336c43d4041740/contracts/contracts/Velo.sol#L4
Contract velo is IVELO { โฆ }
Or perhaps implement IVELO and IERC20 for compliance.
NotifyReward()
It does implement the notifyRewardAmount()
function.
getEpochStart()
has no comment: https://github.com/code-423n4/2022-05-velodrome/blob/7fda97c570b758bbfa7dd6724a336c43d4041740/contracts/contracts/Bribe.sol#L34-L39
Add comment:
/**
timestamp
.*/
notifyRewardAmount()
has no comment: https://github.com/code-423n4/2022-05-velodrome/blob/7fda97c570b758bbfa7dd6724a336c43d4041740/contracts/contracts/Bribe.sol#L40-L60
Add comment:
/**
token
to be added for rewards (to be distributed over time).
*/rewardsListLength()
has no comment: https://github.com/code-423n4/2022-05-velodrome/blob/7fda97c570b758bbfa7dd6724a336c43d4041740/contracts/contracts/Bribe.sol#L61-L64
Add comment:
/**
rewards
list.addRewardToken()
has no comment: https://github.com/code-423n4/2022-05-velodrome/blob/7fda97c570b758bbfa7dd6724a336c43d4041740/contracts/contracts/Bribe.sol#L65-L73
Add comment:
/**
rewards
list - must be gauge
to add token.rewards
*/swapOutRewardToken()
has no comment: https://github.com/code-423n4/2022-05-velodrome/blob/7fda97c570b758bbfa7dd6724a336c43d4041740/contracts/contracts/Bribe.sol#L75-L81
Add comment:
/**
isReward
- must be gauge to swap.rewards
list to be swapped.deliverReward()
has no comment: https://github.com/code-423n4/2022-05-velodrome/blob/7fda97c570b758bbfa7dd6724a336c43d4041740/contracts/contracts/Bribe.sol#L82-L90
Add comment:
/**
_safeTransfer()
has no comment: https://github.com/code-423n4/2022-05-velodrome/blob/7fda97c570b758bbfa7dd6724a336c43d4041740/contracts/contracts/Bribe.sol#L91-L97
Add comment:
/**
safely
transfers the token to an address from this.to
.
*/_safeTransferFrom()
has no comment: https://github.com/code-423n4/2022-05-velodrome/blob/7fda97c570b758bbfa7dd6724a336c43d4041740/contracts/contracts/Bribe.sol#L98-L104
Add Comment: /**
safely
transfers the token from a specific address, to another address.to
.
*/#0 - GalloDaSballo
2022-07-04T21:52:06Z
Valid NC
Don't think it makes a difference
##ย [non-critical] Velo.sol does not implement IVELO or IERC20 Valid NC
##ย Ibribe.sol does not register the event NotifyReward() Valid NC
Nice work!!
Neat report 1 L, 3 NC