mintfunction in the RAACNFT contract is defined as follows:
We can see that this function takes an _amount as argument, and checks that this amount is greater than or equal to the price of the house.
Then, the whole _amount is transferred to the RAACNFT contract and if this _amount is greater than price, a refund is executed.
The refunding pattern can be avoided by directly transferring price to the contract, thus saving gas and avoiding a useless token transfer.
The impact of this issue is low as it consists of useless function calls (safeTransfer) that costs gas and should be avoided.
Manual review
mint function implementation could be modified for:
Indeed, any user can get the price of the house with the getHousePrice function and approve the required amount, allowing to get rid of the _amount parameter while consuming entirely the approval amount:
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.