This report was generated by Aderyn, a static analysis tool built by Cyfrin, a blockchain security company. This report is not a substitute for manual audit or security review. It should not be relied upon for any purpose other than to assist in the identification of potential security vulnerabilities.
| Key | Value |
|---|---|
| .sol Files | 10 |
| Total nSLOC | 719 |
| Filepath | nSLOC |
|---|---|
| src/adapter/PriceLoomAdapterFactory.sol | 30 |
| src/adapter/PriceLoomAggregatorV3Adapter.sol | 51 |
| src/examples/TestPriceConsumer.sol | 12 |
| src/interfaces/AggregatorV3Interface.sol | 14 |
| src/interfaces/IOracleAdmin.sol | 10 |
| src/interfaces/IOracleReader.sol | 20 |
| src/libraries/PriceLoomMath.sol | 35 |
| src/libraries/Sort.sol | 7 |
| src/oracle/PriceLoomOracle.sol | 516 |
| src/oracle/PriceLoomTypes.sol | 24 |
| Total | 719 |
| Category | No. of Issues |
|---|---|
| High | 0 |
| Low | 6 |
Contracts have owners with privileged rights to perform admin tasks and need to be trusted to not perform malicious updates or drain funds.
7 Found Instances
-
Found in src/oracle/PriceLoomOracle.sol Line: 63
contract PriceLoomOracle is AccessControl, Pausable, ReentrancyGuard, EIP712, IOracleAdmin, IOracleReader {
-
Found in src/oracle/PriceLoomOracle.sol Line: 120
onlyRole(FEED_ADMIN_ROLE) -
Found in src/oracle/PriceLoomOracle.sol Line: 155
function setFeedConfig(bytes32 feedId, OracleTypes.FeedConfig calldata cfg) external onlyRole(FEED_ADMIN_ROLE) {
-
Found in src/oracle/PriceLoomOracle.sol Line: 166
function addOperator(bytes32 feedId, address op) external onlyRole(FEED_ADMIN_ROLE) {
-
Found in src/oracle/PriceLoomOracle.sol Line: 177
function removeOperator(bytes32 feedId, address op) external onlyRole(FEED_ADMIN_ROLE) {
-
Found in src/oracle/PriceLoomOracle.sol Line: 199
function pause() external onlyRole(PAUSER_ROLE) {
-
Found in src/oracle/PriceLoomOracle.sol Line: 203
function unpause() external onlyRole(PAUSER_ROLE) {
Define and use constant variables instead of using literals. If the same constant literal value is used multiple times, create a constant state variable and reference it throughout the contract.
4 Found Instances
-
Found in src/libraries/PriceLoomMath.sol Line: 16
return (uint256(1) << 255);
-
Found in src/libraries/PriceLoomMath.sol Line: 25
uint256 ua = uint256(a) ^ (uint256(1) << 255);
-
Found in src/libraries/PriceLoomMath.sol Line: 26
uint256 ub = uint256(b) ^ (uint256(1) << 255);
-
Found in src/libraries/PriceLoomMath.sol Line: 46
if (mu == (uint256(1) << 255)) return type(int256).min;
Large literal values multiples of 10000 can be replaced with scientific notation.Use e notation, for example: 1e18, instead of its full numeric value.
1 Found Instances
-
Found in src/oracle/PriceLoomOracle.sol Line: 605
return OZMath.mulDiv(diff, 10_000, lastAbs) >= uint256(cfg.deviationBps);
Avoid require / revert statements in a loop because a single bad item can cause the whole transaction to fail. It's better to forgive on fail and return failed elements post processing of the loop
2 Found Instances
Invoking SSTORE operations in loops may waste gas. Use a local variable to hold the loop computation result.
3 Found Instances
Function returns a value but it is ignored. Consider checking the return value.
6 Found Instances
-
Found in src/oracle/PriceLoomOracle.sol Line: 108
_grantRole(DEFAULT_ADMIN_ROLE, admin); -
Found in src/oracle/PriceLoomOracle.sol Line: 109
_grantRole(PAUSER_ROLE, admin); -
Found in src/oracle/PriceLoomOracle.sol Line: 110
_grantRole(FEED_ADMIN_ROLE, admin); -
Found in src/oracle/PriceLoomOracle.sol Line: 318
_handleTimeoutIfNeeded(feedId); -
Found in src/oracle/PriceLoomOracle.sol Line: 341
_handleTimeoutIfNeeded(feedId); -
Found in src/oracle/PriceLoomOracle.sol Line: 393
_handleTimeoutIfNeeded(feedId);