Open hats-bug-reporter[bot] opened 1 year ago
Hello, Thanks a lot for your attention.
This is the expected behavior, the calculation is correct. However, due to this misunderstanding we are going to add more comments on the decimals information.
We have so to consider this issue as Invalid.
Github username: @8ahoz Submission hash (on-chain): 0x04e7fb03d4f60acd19c8e20675e591d941d9d7e2bbb1d85509458ed0ad0ae638 Severity: medium
Description: Description:
Ibo.sol
contract has a check that assures a user can not mint more then a percentage of themaxCvgToMint
.That percentage is stored in
BondParams
aspercentageMaxCvgToMint
. Checking the comment about the parameters shows that the percentage was supposed to be stored as a double digit percentage value:Please note the difference between the comments of
minRoi
,maxRoi
andpercentageMaxCvgToMint
. Which shows percentageMaxCvgToMint value supposed to be a two digit value that supposed to be denominated by 100(10^2)config.js
in the scripts folder proves this inference:However,
Ibo.sol
calculates the max cvg per bond value by dividing it by10^3
. This means the actualpercentageMaxCvgToMint
will be 1/10 of the expected value. Causing users to send 10x more transactions to mint the amount they wanted to mint if they want to mint a big amount. This leads both lose of funds in form of gas and some users may end up minting less amount than they wanted if the total supply gets minted before they send more transactionsProof of Concept:
Impact:
Deviation from an important behavior of the contract
Unexpectedly failing mints
Users loosing funds for gas
Users being force to send multiple transactions
Users may mint less than they expected
Recommended Mitigation:
10**3
to10**2
at: https://github.com/hats-finance/Convergence-Finance---IBO-0x0e410e7af8e70fc5bffcdbfbdf1673ee7b3d0777/blob/f43c5d9bc6b30c9f488e34836f09dc04d8f7361f/contracts/PresaleVesting/Ibo.sol#L202