You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
H-1: Arbitrary from passed to transferFrom (or safeTransferFrom)
Passing an arbitrary from address to transferFrom (or safeTransferFrom) can lead to loss of funds, because anyone can transfer tokens from the from address if an approval is made.
L-1: abi.encodePacked() should not be used with dynamic types when passing the result to a hash function such as keccak256()
Use abi.encode() instead which will pad items to 32 bytes, which will prevent hash collisions (e.g. abi.encodePacked(0x123,0x456) => 0x123456 => abi.encodePacked(0x1,0x23456), but abi.encode(0x123,0x456) => 0x0...1230...456). Unless there is a compelling reason, abi.encode should be preferred. If there is only one argument to abi.encodePacked() it can often be cast to bytes() or bytes32()instead.
If all arguments are strings and or bytes, bytes.concat() should be used instead.
Found in contracts/utils/nfts/DefGenerator.sol Line: 31
abi.encodePacked(
Found in contracts/utils/nfts/NFTMetadataGenerator.sol Line: 25
ERC20 functions may not behave as expected. For example: return values are not always meaningful. It is recommended to use OpenZeppelin's SafeERC20 library.
Consider using a specific version of Solidity in your contracts instead of a wide version. For example, instead of pragma solidity ^0.8.0;, use pragma solidity 0.8.0;
Found in contracts/LiquidationPoolManager.sol Line: 2
pragma solidity^0.8.17;
Found in contracts/interfaces/ILiquidationPool.sol Line: 2
pragma solidity^0.8.17;
Found in contracts/interfaces/ILiquidationPoolManager.sol Line: 2
pragma solidity^0.8.17;
Found in contracts/utils/MockSmartVaultManager.sol Line: 2
pragma solidity^0.8.17;
L-5: Conditional storage checks are not consistent
When writing require or if conditionals that check storage values, it is important to be consistent to prevent off-by-one errors. There are instances found where the same storage variable is checked multiple times, but the conditionals are not consistent.
Solc compiler version 0.8.20 switches the default target EVM version to Shanghai, which means that the generated bytecode will include PUSH0 opcodes. Be sure to select the appropriate EVM version in case you intend to deploy on a chain other than mainnet like L2 chains that may not support PUSH0, otherwise deployment of your contracts will fail.
Found in contracts/utils/nfts/NFTMetadataGenerator.sol Line: 41
'{"trait_type": "Collateral Value in EUROs", "display_type": "number", "value": ',NFTUtils.toDecimalString(_vaultStatus.totalCollateralValue, 18),'},',
Found in contracts/utils/nfts/NFTMetadataGenerator.sol Line: 42
Index event fields make the field more quickly accessible to off-chain tools that parse events. However, note that each index field costs extra gas during emission, so it's not necessarily best to index the maximum allowed per event (three fields). Each event should use three indexed fields if there are three or more fields, and gas usage is not particularly of concern for the events in question. If there are fewer than three fields, all of the fields should be indexed.
Found in contracts/SmartVaultManagerV5.sol Line: 37
Aderyn Analysis Report
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.
Table of Contents
from
passed totransferFrom
(orsafeTransferFrom
)ERC721::_mint()
can be dangerousabi.encodePacked()
should not be used with dynamic types when passing the result to a hash function such askeccak256()
address(0)
when assigning values to address state variablesindexed
fieldsrequire()
/revert()
statements should have descriptive reason strings or custom errorsSummary
Files Summary
Files Details
Issue Summary
High Issues
H-1: Arbitrary
from
passed totransferFrom
(orsafeTransferFrom
)Passing an arbitrary
from
address totransferFrom
(orsafeTransferFrom
) can lead to loss of funds, because anyone can transfer tokens from thefrom
address if an approval is made.Found in contracts/LiquidationPool.sol Line: 232
Medium Issues
M-1: Centralization Risk for trusted owners
Contracts have owners with privileged rights to perform admin tasks and need to be trusted to not perform malicious updates or drain funds.
Found in contracts/LiquidationPoolManager.sol Line: 11
Found in contracts/LiquidationPoolManager.sol Line: 84
Found in contracts/SmartVaultManagerV5.sol Line: 103
Found in contracts/SmartVaultManagerV5.sol Line: 107
Found in contracts/SmartVaultManagerV5.sol Line: 111
Found in contracts/SmartVaultManagerV5.sol Line: 115
Found in contracts/SmartVaultManagerV5.sol Line: 119
Found in contracts/SmartVaultManagerV5.sol Line: 123
Found in contracts/SmartVaultManagerV5.sol Line: 127
Found in contracts/SmartVaultManagerV5.sol Line: 131
Found in contracts/SmartVaultManagerV5.sol Line: 135
Found in contracts/SmartVaultV3.sol Line: 135
Found in contracts/SmartVaultV3.sol Line: 142
Found in contracts/SmartVaultV3.sol Line: 149
Found in contracts/SmartVaultV3.sol Line: 160
Found in contracts/SmartVaultV3.sol Line: 214
Found in contracts/utils/EUROsMock.sol Line: 8
Found in contracts/utils/EUROsMock.sol Line: 18
Found in contracts/utils/EUROsMock.sol Line: 22
Found in contracts/utils/SmartVaultIndex.sol Line: 7
Found in contracts/utils/SmartVaultIndex.sol Line: 43
Found in contracts/utils/SmartVaultManager.sol Line: 115
Found in contracts/utils/SmartVaultManager.sol Line: 119
Found in contracts/utils/TokenManagerMock.sol Line: 9
Found in contracts/utils/TokenManagerMock.sol Line: 36
Found in contracts/utils/TokenManagerMock.sol Line: 45
M-2: Using
ERC721::_mint()
can be dangerousUsing
ERC721::_mint()
can mint ERC721 tokens to addresses which don't support ERC721 tokens. Use_safeMint()
instead of_mint()
for ERC721.Found in contracts/utils/ERC20Mock.sol Line: 14
_mint(to, amount);
Found in contracts/utils/EUROsMock.sol Line: 19
_mint(to, amount);
Low Issues
L-1:
abi.encodePacked()
should not be used with dynamic types when passing the result to a hash function such askeccak256()
Use
abi.encode()
instead which will pad items to 32 bytes, which will prevent hash collisions (e.g.abi.encodePacked(0x123,0x456)
=>0x123456
=>abi.encodePacked(0x1,0x23456)
, butabi.encode(0x123,0x456)
=>0x0...1230...456
). Unless there is a compelling reason,abi.encode
should be preferred. If there is only one argument toabi.encodePacked()
it can often be cast tobytes()
orbytes32()
instead.If all arguments are strings and or bytes,
bytes.concat()
should be used instead.Found in contracts/utils/nfts/DefGenerator.sol Line: 31
abi.encodePacked(
Found in contracts/utils/nfts/NFTMetadataGenerator.sol Line: 25
Found in contracts/utils/nfts/NFTMetadataGenerator.sol Line: 31
abi.encodePacked(
Found in contracts/utils/nfts/NFTMetadataGenerator.sol Line: 33
Found in contracts/utils/nfts/NFTUtils.sol Line: 66
Found in contracts/utils/nfts/SVGGenerator.sol Line: 39
Found in contracts/utils/nfts/SVGGenerator.sol Line: 53
Found in contracts/utils/nfts/SVGGenerator.sol Line: 69
Found in contracts/utils/nfts/SVGGenerator.sol Line: 75
Found in contracts/utils/nfts/SVGGenerator.sol Line: 80
Found in contracts/utils/nfts/SVGGenerator.sol Line: 87
abi.encodePacked(
L-2: Deprecated OpenZeppelin functions should not be used
Openzeppelin has deprecated several functions and replaced with newer versions. Please consult https://docs.openzeppelin.com/
Found in contracts/SmartVaultV3.sol Line: 198
L-3: Unsafe ERC20 Operations should not be used
ERC20 functions may not behave as expected. For example: return values are not always meaningful. It is recommended to use OpenZeppelin's SafeERC20 library.
Found in contracts/LiquidationPool.sol Line: 175
Found in contracts/LiquidationPoolManager.sol Line: 37
eurosToken.approve(pool, _feesForPool);
Found in contracts/LiquidationPoolManager.sol Line: 40
Found in contracts/LiquidationPoolManager.sol Line: 54
Found in contracts/LiquidationPoolManager.sol Line: 76
ierc20.approve(pool, erc20balance);
Found in contracts/utils/MockSmartVaultManager.sol Line: 35
L-4: Solidity pragma should be specific, not wide
Consider using a specific version of Solidity in your contracts instead of a wide version. For example, instead of
pragma solidity ^0.8.0;
, usepragma solidity 0.8.0;
Found in contracts/LiquidationPool.sol Line: 2
Found in contracts/LiquidationPoolManager.sol Line: 2
Found in contracts/interfaces/ILiquidationPool.sol Line: 2
Found in contracts/interfaces/ILiquidationPoolManager.sol Line: 2
Found in contracts/utils/MockSmartVaultManager.sol Line: 2
L-5: Conditional storage checks are not consistent
When writing
require
orif
conditionals that check storage values, it is important to be consistent to prevent off-by-one errors. There are instances found where the same storage variable is checked multiple times, but the conditionals are not consistent.Found in contracts/SmartVaultV3.sol Line: 54
Found in contracts/SmartVaultV3.sol Line: 80
Found in contracts/SmartVaultV3.sol Line: 100
Found in contracts/SmartVaultV3.sol Line: 121
Found in contracts/SmartVaultV3.sol Line: 128
Found in contracts/SmartVaultV3.sol Line: 132
Found in contracts/SmartVaultV3.sol Line: 157
Found in contracts/SmartVaultV3.sol Line: 163
Found in contracts/SmartVaultV3.sol Line: 171
Found in contracts/SmartVaultV3.sol Line: 208
Found in contracts/utils/SmartVaultManager.sol Line: 79
Found in contracts/utils/SmartVaultManager.sol Line: 93
Found in contracts/utils/nfts/SVGGenerator.sol Line: 35
Found in contracts/utils/nfts/SVGGenerator.sol Line: 73
L-6: PUSH0 is not supported by all chains
Solc compiler version 0.8.20 switches the default target EVM version to Shanghai, which means that the generated bytecode will include PUSH0 opcodes. Be sure to select the appropriate EVM version in case you intend to deploy on a chain other than mainnet like L2 chains that may not support PUSH0, otherwise deployment of your contracts will fail.
Found in contracts/LiquidationPool.sol Line: 2
Found in contracts/LiquidationPoolManager.sol Line: 2
Found in contracts/interfaces/ILiquidationPool.sol Line: 2
Found in contracts/interfaces/ILiquidationPoolManager.sol Line: 2
Found in contracts/utils/MockSmartVaultManager.sol Line: 2
NC Issues
NC-1: Missing checks for
address(0)
when assigning values to address state variablesAssigning values to address state variables without checking for
address(0)
.Found in contracts/LiquidationPool.sol Line: 35
tokenManager = _tokenManager;
Found in contracts/SmartVaultManagerV5.sol Line: 116
weth = _weth;
Found in contracts/SmartVaultManagerV5.sol Line: 120
swapRouter2 = _swapRouter;
Found in contracts/SmartVaultManagerV5.sol Line: 124
nftMetadataGenerator = _nftMetadataGenerator;
Found in contracts/SmartVaultManagerV5.sol Line: 128
smartVaultDeployer = _smartVaultDeployer;
Found in contracts/SmartVaultManagerV5.sol Line: 132
protocol = _protocol;
Found in contracts/SmartVaultManagerV5.sol Line: 136
liquidator = _liquidator;
Found in contracts/SmartVaultV3.sol Line: 37
owner = _owner;
Found in contracts/SmartVaultV3.sol Line: 234
owner = _newOwner;
Found in contracts/utils/SmartVaultIndex.sol Line: 44
manager = _manager;
Found in contracts/utils/SmartVaultManager.sol Line: 45
euros = _euros;
Found in contracts/utils/SmartVaultManager.sol Line: 48
protocol = _protocol;
Found in contracts/utils/SmartVaultManager.sol Line: 49
liquidator = _liquidator;
Found in contracts/utils/SmartVaultManager.sol Line: 50
tokenManager = _tokenManager;
Found in contracts/utils/SmartVaultManager.sol Line: 51
smartVaultDeployer = _smartVaultDeployer;
Found in contracts/utils/SmartVaultManager.sol Line: 53
nftMetadataGenerator = _nftMetadataGenerator;
NC-2: Functions not used internally could be marked external
Found in contracts/SmartVaultManagerV5.sol Line: 46
Found in contracts/SmartVaultManagerV5.sol Line: 94
Found in contracts/utils/ERC20Mock.sol Line: 13
Found in contracts/utils/ERC20Mock.sol Line: 17
Found in contracts/utils/EUROsMock.sol Line: 18
Found in contracts/utils/EUROsMock.sol Line: 22
Found in contracts/utils/SmartVaultManager.sol Line: 41
Found in contracts/utils/SmartVaultManager.sol Line: 106
NC-3: Constants should be defined and used instead of literals
Found in contracts/LiquidationPool.sol Line: 99
Found in contracts/LiquidationPool.sol Line: 106
Found in contracts/LiquidationPool.sol Line: 107
Found in contracts/LiquidationPool.sol Line: 120
Found in contracts/LiquidationPool.sol Line: 220
Found in contracts/SmartVaultManagerV5.sol Line: 71
Found in contracts/SmartVaultV3.sol Line: 221
fee: 3000,
Found in contracts/utils/ChainlinkMock.sol Line: 17
Found in contracts/utils/ChainlinkMock.sol Line: 25
Found in contracts/utils/ChainlinkMock.sol Line: 37
Found in contracts/utils/ChainlinkMock.sol Line: 47
Found in contracts/utils/PriceCalculator.sol Line: 19
Found in contracts/utils/PriceCalculator.sol Line: 25
Found in contracts/utils/PriceCalculator.sol Line: 26
Found in contracts/utils/PriceCalculator.sol Line: 40
Found in contracts/utils/PriceCalculator.sol Line: 45
Found in contracts/utils/PriceCalculator.sol Line: 46
Found in contracts/utils/PriceCalculator.sol Line: 53
Found in contracts/utils/PriceCalculator.sol Line: 64
Found in contracts/utils/SmartVaultManager.sol Line: 79
Found in contracts/utils/SmartVaultManager.sol Line: 93
Found in contracts/utils/TokenManagerMock.sol Line: 20
Found in contracts/utils/TokenManagerMock.sol Line: 49
Found in contracts/utils/nfts/DefGenerator.sol Line: 14
Found in contracts/utils/nfts/DefGenerator.sol Line: 22
Found in contracts/utils/nfts/DefGenerator.sol Line: 23
Found in contracts/utils/nfts/NFTMetadataGenerator.sol Line: 39
Found in contracts/utils/nfts/NFTMetadataGenerator.sol Line: 40
Found in contracts/utils/nfts/NFTMetadataGenerator.sol Line: 41
Found in contracts/utils/nfts/NFTMetadataGenerator.sol Line: 42
Found in contracts/utils/nfts/NFTUtils.sol Line: 14
Found in contracts/utils/nfts/NFTUtils.sol Line: 16
Found in contracts/utils/nfts/NFTUtils.sol Line: 43
Found in contracts/utils/nfts/NFTUtils.sol Line: 59
Found in contracts/utils/nfts/NFTUtils.sol Line: 60
Found in contracts/utils/nfts/NFTUtils.sol Line: 61
Found in contracts/utils/nfts/SVGGenerator.sol Line: 29
Found in contracts/utils/nfts/SVGGenerator.sol Line: 30
Found in contracts/utils/nfts/SVGGenerator.sol Line: 31
Found in contracts/utils/nfts/SVGGenerator.sol Line: 35
Found in contracts/utils/nfts/SVGGenerator.sol Line: 37
Found in contracts/utils/nfts/SVGGenerator.sol Line: 60
Found in contracts/utils/nfts/SVGGenerator.sol Line: 67
Found in contracts/utils/nfts/SVGGenerator.sol Line: 68
Found in contracts/utils/nfts/SVGGenerator.sol Line: 73
Found in contracts/utils/nfts/SVGGenerator.sol Line: 80
Found in contracts/utils/nfts/SVGGenerator.sol Line: 106
Found in contracts/utils/nfts/SVGGenerator.sol Line: 110
Found in contracts/utils/nfts/SVGGenerator.sol Line: 118
NC-4: Event is missing
indexed
fieldsIndex event fields make the field more quickly accessible to off-chain tools that parse events. However, note that each index field costs extra gas during emission, so it's not necessarily best to index the maximum allowed per event (three fields). Each event should use three indexed fields if there are three or more fields, and gas usage is not particularly of concern for the events in question. If there are fewer than three fields, all of the fields should be indexed.
Found in contracts/SmartVaultManagerV5.sol Line: 37
Found in contracts/SmartVaultManagerV5.sol Line: 39
Found in contracts/SmartVaultV3.sol Line: 30
Found in contracts/SmartVaultV3.sol Line: 31
Found in contracts/SmartVaultV3.sol Line: 32
Found in contracts/SmartVaultV3.sol Line: 33
Found in contracts/utils/SmartVaultManager.sol Line: 32
Found in contracts/utils/SmartVaultManager.sol Line: 34
Found in contracts/utils/TokenManagerMock.sol Line: 15
Found in contracts/utils/TokenManagerMock.sol Line: 16
NC-5:
require()
/revert()
statements should have descriptive reason strings or custom errorsFound in contracts/LiquidationPool.sol Line: 135
Found in contracts/LiquidationPool.sol Line: 173
require(_sent);
Found in contracts/LiquidationPool.sol Line: 200
require(_sent);
Found in contracts/LiquidationPoolManager.sol Line: 50
require(_sent);
Found in contracts/utils/MockSmartVaultManager.sol Line: 30
require(_sent);
The text was updated successfully, but these errors were encountered: