Open hats-bug-reporter[bot] opened 4 months ago
hey @rotcivegaf , #23 is invalid as the scenario mentioned always reverts
@party-for-illuminati ?
1 sathoshi...
@party-for-illuminati ?
This report is correctly labelled as invalid
hey @rotcivegaf @party-for-illuminati , i agree with your decision.just curious why the issue is invalid(for feedback)
In this case the protocol at most can lose 1 wei(satoshi) per transaction, because there is a minWithdrawalLimit
so the amount
should be greather than amount + (BYTES_PER_OUTGOING_TRANSFER * satoshiPerByte)
Finally the amount
can't be 1000
and at most the protocol lose 1 wei at max, also if the amount can be 1000
PD.: Read this report: the-graph-rounding-error
i just want to elaborate that 1 satoshi is lost from a (1e8) bitcoin (which is not a dust value) and will cause leak of value on the long run
i agree with @IlIlHunterlIlI ,
i just want to elaborate that 1 satoshi is lost from a (1e8) bitcoin (which is not a dust value) and will cause leak of value on the long run
If we calculate the loss practically (this can be exploited by anyone as the difficulty for exploitation is very low):
Now,
Max Loss of protocol fees:
As we can see, the protocol will incur significant losses due to the rounding issue, and these losses will compound over time.
@party-for-illuminati waiting for your response on this..
@party-for-illuminati ?
Github username: -- Twitter username: -- Submission hash (on-chain): 0xa9dbdbe406aaffd48b1b01f605dcecb8923051c805b9d7f043a1e8b383be1f1d Severity: medium
Description: Description\ The
withdraw
function in theVaultBitcoinWallet
contract has a precision issue when calculatingprotocol fees
. Due to Solidity's integer division, amounts can result in the protocolFees being rounded down to zero, which is not the intended behavior.Attack Scenario\ let's examine this with example
amount=1000
minReceiveAmount=750
BYTES_PER_OUTGOING_TRANSFER=30
satoshiPerByte=1
now by calling
withdraw()
function with the above paramters users can bypass protocol feesamountAfterNetworkFee:
protocolFees:
as we can see here by using this anyuser can bypass protocol fees
Attachments
Proof of Concept (PoC) File
Revised Code File (Optional)