code4rena-2023-01-biconomy-l07

[L-07] Loss of precision due to rounding

보고서

Summary

반올림으로 인해 계산의 정확성이 떨어진다고 지적했다.

Keyword

precision, rounding error, loss of precision

Vulnerability

2 results - 1 file
 
contracts/smart-contract-wallet/SmartAccount.sol:
  264:             payment = (gasUsed + baseGas) * (gasPrice) / (tokenGasPriceFactor);
  288:             payment = (gasUsed + baseGas) * (gasPrice) / (tokenGasPriceFactor);

반올림으로 인해 계산의 정확성이 떨어진다고 지적했다.

Impact

계산의 정확성이 떨어진다.

Mitigation

반올림을 무시하기 위해 scalar를 추가한다.

Memo

보고서에도 뭔가 설명이 부족해서 원하는 바가 뭔지 잘 모르겠다. 추측으로는 분자, 분모에 고정값을 곱하여 계산의 정확도를 높이자는 것 같다..?


tags: bughunting, smart contract, biconomy, account abstraction, erc4337, arithmetic error, rounding error, loss of precision, wallet, severity low