From 2cfb2ce189b6c874698db9bfd845c40d5b740f68 Mon Sep 17 00:00:00 2001 From: han Date: Thu, 23 Jan 2025 23:02:58 +0700 Subject: [PATCH] add audit comment on convertUSDtoIDR --- src/IDRCoin.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/src/IDRCoin.sol b/src/IDRCoin.sol index 53c77a1..7c1eec8 100644 --- a/src/IDRCoin.sol +++ b/src/IDRCoin.sol @@ -91,6 +91,7 @@ contract IDRCoin is ERC20 { // external/public function // anyone can buy IDRC with USDT with fixed conversion rate function convertUSDtoIDR(uint256 amountInUSD) external { + // @audit: there is no check for 0 amount usdt.transferFrom(msg.sender, address(this), amountInUSD); // first we normalize the amount in usd by dividing it with its own decimals // then we multiply it with the conversion rate and IDRC decimals