The documentation is stating that a borrower can take up to 5 loans against the same NFT, but the code is not limiting the borrower. Considering adding a check to limit the number of loans or update the documentation.
Upgradable contracts should be initialized only once. Consider adding a check to prevent multiple calls to the init method. Even if the method is technically not callable by anyone and it is setting the delegate address and the allow list. It is still a good practice to add a check to prevent multiple calls.
Code architecture, incentives, and error handling/reporting questions/issues should be resolved before deployment.
// check for rounding error since we round down in previewRedeem.
- src/contract/CollateralToken.sol
- src/contract/CollateralToken.sol
- src/contract/CollateralToken.sol
- src/contract/WithdrawProxy.sol
ERC20 tokenContract = ERC20(tokenAddress);
- src/contract/AstariaRouter.sol
- src/contract/AstariaRouter.sol
- src/contract/CollateralToken.sol
- src/contract/LienToken.sol
- src/contract/LienToken.sol
- src/contract/LienToken.sol
- src/contract/LienToken.sol
As mentioned in solidity documention, it is recommended to follow the order layout in contract.
- Type declarations
- State variables
- Events
- Modifiers
- Functions
NatSpec is missing for some functions.
Considering the number of conditions, it is recommended to use switch statement instead of if-else.
Use pragma abicoder v2 instead