This is dust amount not worth the gas unless token's decimals are very low and replenishmentPriceBps is also very low.
5. Oracle's lows are observational not actual
The oracle design relies on the assumption that low prices are observed by the smart contract. There is no guarantee nor incentives that this would happen. In rarely used markets this could defy the original dampening intention.
Summary
latestAnswer()
is deprecatedNon-critical Issues
1.
latestAnswer()
is deprecatedAs per Chainlink's documentation, the
latestAnswer
function is deprecated.There are 2 instances of this issue:
https://github.com/code-423n4/2022-10-inverse/blob/3e81f0f5908ea99b36e6ab72f13488bbfe622183/src/Oracle.sol#L82
https://github.com/code-423n4/2022-10-inverse/blob/3e81f0f5908ea99b36e6ab72f13488bbfe622183/src/Oracle.sol#L116
2. Open TODO(s)
Open questions should be resolved before deployment
There is one instance of this issue:
https://github.com/code-423n4/2022-10-inverse/blob/3e81f0f5908ea99b36e6ab72f13488bbfe622183/src/escrows/INVEscrow.sol#L35
3. Proxy implementation contract not initialized
The escrow implementation contracts can be initialised by anyone calling the initialize function. Not critical in this case.
[Reference 1](https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#initializing_the_implementation_contract](https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#initializing_the_implementation_contract)
Reference 2
There are 3 instances of this issue:
https://github.com/code-423n4/2022-10-inverse/blob/3e81f0f5908ea99b36e6ab72f13488bbfe622183/src/escrows/GovTokenEscrow.sol#L30
https://github.com/code-423n4/2022-10-inverse/blob/3e81f0f5908ea99b36e6ab72f13488bbfe622183/src/escrows/INVEscrow.sol#L44
https://github.com/code-423n4/2022-10-inverse/blob/3e81f0f5908ea99b36e6ab72f13488bbfe622183/src/escrows/SimpleERC20Escrow.sol#L25
3. User could mint DBR for free
Due to loss of precision no cost is accrued in the following function if
$amount < 10000/ replenishmentPriceBps$
https://github.com/code-423n4/2022-10-inverse/blob/3e81f0f5908ea99b36e6ab72f13488bbfe622183/src/Market.sol#L559
DBR could be minted in the called function if a user is in deficit.
https://github.com/code-423n4/2022-10-inverse/blob/3e81f0f5908ea99b36e6ab72f13488bbfe622183/src/DBR.sol#L325
This is dust amount not worth the gas unless token's decimals are very low and
replenishmentPriceBps
is also very low.5. Oracle's lows are observational not actual
The oracle design relies on the assumption that low prices are observed by the smart contract. There is no guarantee nor incentives that this would happen. In rarely used markets this could defy the original dampening intention.
https://github.com/code-423n4/2022-10-inverse/blob/3e81f0f5908ea99b36e6ab72f13488bbfe622183/src/Oracle.sol#L112
Code Style
1. Rename function
Although this name is used in a popular library, it is not expressive enough;
calculateEscrowAddress
would be a better name.https://github.com/code-423n4/2022-10-inverse/blob/3e81f0f5908ea99b36e6ab72f13488bbfe622183/src/Market.sol#L292