add audit comment on convertUSDtoIDR
Some checks failed
CI / Foundry project (push) Has been cancelled

This commit is contained in:
han 2025-01-23 23:02:58 +07:00
parent f41d93d6be
commit 2cfb2ce189

View File

@ -91,6 +91,7 @@ contract IDRCoin is ERC20 {
// external/public function // external/public function
// anyone can buy IDRC with USDT with fixed conversion rate // anyone can buy IDRC with USDT with fixed conversion rate
function convertUSDtoIDR(uint256 amountInUSD) external { function convertUSDtoIDR(uint256 amountInUSD) external {
// @audit: there is no check for 0 amount
usdt.transferFrom(msg.sender, address(this), amountInUSD); usdt.transferFrom(msg.sender, address(this), amountInUSD);
// first we normalize the amount in usd by dividing it with its own decimals // 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 // then we multiply it with the conversion rate and IDRC decimals