Found in line 287 at 2023-07-foundry-defi-stablecoin/src/DSCEngine.sol:
bool success = IERC20(tokenCollateralAddress).transfer(to, amountCollateral);
.transfer will relay 2300 gas and .call will relay all the gas. If the receive/fallback function from the recipient proxy contract has complex logic, using .transfer will fail, causing integration issues.Replace .transfer with .call. Note that the result of .call need to be checked.
Found in line 64 at 2023-07-foundry-defi-stablecoin/src/DecentralizedStableCoin.sol:
_mint(_to, _amount);
.mint won’t check if the recipient is able to receive the NFT. If an incorrect address is passed, it will result in a silent failure and loss of asset. OpenZeppelin recommendation is to use the safe variant of _mint. Replace _mint() with _safeMint().
Found in line 82 at 2023-07-foundry-defi-stablecoin/src/DSCEngine.sol:
DecentralizedStableCoin private immutable i_dsc;
Immutables should be in uppercase, it helps to distinguish immutables from other types of variables and provides better code readability.
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.