From dd0d72f5338ba128ab8601740eddf1b1f4973bd3 Mon Sep 17 00:00:00 2001 From: C4 <81770958+code423n4@users.noreply.github.com> Date: Sat, 8 Oct 2022 13:18:33 +0200 Subject: [PATCH] RockingMiles data for issue #11 --- data/RockingMiles-Q.md | 278 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 278 insertions(+) create mode 100644 data/RockingMiles-Q.md diff --git a/data/RockingMiles-Q.md b/data/RockingMiles-Q.md new file mode 100644 index 0000000..261d4a7 --- /dev/null +++ b/data/RockingMiles-Q.md @@ -0,0 +1,278 @@ +## Missing fee parameter validation + + +Some fee parameters of functions are not checked for invalid values. Validate the parameters: + + +### Code instances: + + Rebates.addToPool (_indexerFees) + Staking._setDelegationParameters (_queryFeeCut) + Cobbs.cobbDouglas (fees) + Cobbs.cobbDouglas (totalFees) + Staking.setDelegationParameters (_queryFeeCut) + Rebates.redeem (_indexerFees) + + + +## safeApprove of openZeppelin is deprecated + + +You use safeApprove of openZeppelin although it's deprecated. +(see https://github.com/OpenZeppelin/openzeppelin-contracts/blob/566a774222707e424896c0c390a84dc3c13bdcb2/contracts/token/ERC20/utils/SafeERC20.sol#L38) +You should change it to increase/decrease Allowance as OpenZeppilin says. + +### Code instances: + + Deprecated safeApprove in BridgeEscrow.sol line 28: graphToken().approve(_spender, type(uint256).max); + Deprecated safeApprove in GNS.sol line 173: graphToken().approve(address(curation()), MAX_UINT256); + Deprecated safeApprove in AllocationExchange.sol line 77: graphToken.approve(address(staking), MAX_UINT256); + + + +## Require with empty message + +The following requires are with empty messages. +This is very important to add a message for any require. So the user has enough information to know the reason of failure. +### Code instances: + + Solidity file: GraphProxyAdmin.sol, In line 47 with Empty Require message. + Solidity file: BancorFormula.sol, In line 416 with Empty Require message. + Solidity file: BancorFormula.sol, In line 284 with Empty Require message. + Solidity file: GraphProxyAdmin.sol, In line 59 with Empty Require message. + Solidity file: BancorFormula.sol, In line 366 with Empty Require message. + Solidity file: BancorFormula.sol, In line 327 with Empty Require message. + Solidity file: GraphProxy.sol, In line 133 with Empty Require message. + Solidity file: GraphProxyAdmin.sol, In line 34 with Empty Require message. + Solidity file: BancorFormula.sol, In line 509 with Empty Require message. + + + +## Require with not comprehensive message + +The following requires has a non comprehensive messages. +This is very important to add a comprehensive message for any require. Such that the user has enough +information to know the reason of failure: + +### Code instances: + + Solidity file: Staking.sol, In line 1185 with Require message: