Merge branch 'audit' of git.fbrns.co:han/2025-01-scai-idrcoin into audit

This commit is contained in:
han 2025-01-24 18:08:34 +07:00
commit 0e38a0c45c

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