in RAACNFT.sol, the mint()
function will mint an RAAC NFT based on the tokenid passed in the function. To be able to receive the minted NFT, the user would have to transfer ERC20 payment tokens to RAACNFT.sol based on the price of the corresponding real estate asset. However, the function does not ensure that the value of the payment tokens transferred is equals to the price of the real estate asset in USD.
In the above function:
price of the real estate asset is retrieve from Chainlink oracle via tokenToHousePrice()
. The oracle will return price in USD. Assuming price = 100,000USD
Assume that the ERC20 payment token is LINK and is in 18 decimals, and _amount
= 100000e18
Assume that _amount
> price, hence if statement in line 4 will not execute and proceed
payment tokens are transferred to RAACNFT.sol without retrieving the USD price of the payment token. Assume current price of LINK = $17USD. Transferring 100,000 LINK is transferring 1.7 million USD worth of tokens, when the price of the asset is only 100,000USD.
The value of the ERC20 used for payment in USD is not retrieved - this leads to extremely problematic transfer amounts. Depending on the ERC20 used, the value of the token in USD could be extremely large (e.g WBTC), or extremely low as well.
Although currently, the payment token is crvUSD, it is still incorrect to assume that crvUSD price is 1:1 to USD. Even if protocol would not accept any other ERC20 payment tokens, the price of crvUSD should still be retrieved from oracle.
Manual
Ensure the price in USD of the ERC20 token used as payment is retrieved via oracle, ensuring freshness and decimals of the retrieved price are handled correctly.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.