This issue will go over each of the reports in the audit and describe the changes needed for each of them. We can create separate issues for each of the points if needed.
As discussed, we keep the happy code path cheaper and it would revert on deposit if there is no allowance either ways
Import SafeERC20 and use safeAppove() in _stake(), and _claimSecondaryRewards()
Point missing in audit
Import SafeERC20 and use safeTransfer() in _withdraw()
In order to keep the parameters to the init function consistent across integrations, we don't want to pass any additional vars to it. There is a zero address check for this while performing the swap and it will not take place until it is set.
Event params for GovernanceUpdate - not all the values are addresses and we'd have to use bytes so we can pass uints/addresses. Add oldValue and newValue params.
Low Severity issues
1.
Remove return values from _mint(), _mintShare
Outdated comment - remove it, amount has to be passed
We don't want stake() to revert if the amount is 0 as it's being used in claimRewards(), and we want _claimRewards even if the stake() amount is 0
Remove _node == address(0) check in _stake()
In Graph.sol, while staking, return the function if delegate() fails
This issue will go over each of the reports in the audit and describe the changes needed for each of them. We can create separate issues for each of the points if needed.
Audit report: Tenderize_11032022_SCAudit_Report.pdf
High Severity issues
Medium Severity issues
safeAppove()
in_stake()
, and_claimSecondaryRewards()
safeTransfer()
in_withdraw()
GovernanceUpdate
- not all the values are addresses and we'd have to use bytes so we can pass uints/addresses. AddoldValue
andnewValue
params.Low Severity issues 1.
_mint()
,_mintShare
claimRewards()
, and we want_claimRewards
even if the stake() amount is 0_node == address(0)
check in_stake()