Badger eBTC Audit + Certora Formal Verification Competition - fatherOfBlocks's results

Use stETH to borrow Bitcoin with 0% fees | The only smart contract based #BTC.

General Information

Platform: Code4rena

Start Date: 24/10/2023

Pot Size: $149,725 USDC

Total HM: 7

Participants: 52

Period: 21 days

Judge: ronnyx2017

Total Solo HM: 2

Id: 300

League: ETH

eBTC Protocol

Findings Distribution

Researcher Performance

Rank: 46/52

Findings: 1

Award: $19.71

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

19.712 USDC - $19.71

Labels

bug
grade-b
QA (Quality Assurance)
insufficient quality report
Q-26

External Links

/packages/contracts/contracts/HintHelpers.sol

  • L182 - abi.encodePacked() should not be used with dynamic types when passing the result to a hash function such as keccak256() Use abi.encode() instead which will pad items to 32 bytes, which will prevent hash collisions (e.g. abi.encodePacked(0x123,0x456) => 0x123456 => abi.encodePacked(0x1,0x23456), but abi.encode(0x123,0x456) => 0x0...1230...456). “Unless there is a compelling reason, abi.encode should be preferred”. If there is only one argument to abi.encodePacked() it can often be cast to bytes() or bytes32() instead. If all arguments are strings and or bytes, bytes.concat() should be used instead.

  • L145 - Divisions are made by the input _price and it is not validated if the value is != 0, therefore it should be previously validated to avoid generating unhandled exceptions.

/packages/contracts/contracts/LeverageMacroBase.sol

  • L452/453/454/455/456 - Requires are created but without an error message, it would be beneficial for these to have it so that the user can better understand what is happening in the state of the contract.

/packages/contracts/contracts/SimplifiedDiamondLike.sol

  • L52/56/67/77/154 - Requires are created but without an error message, it would be beneficial for these to have it so that the user can better understand what is happening in the state of the contract.

/packages/contracts/contracts/Dependencies/EbtcBase.sol

  • L108 - Division is performed by the input _amount and it is not validated if the value is != 0, therefore it should be previously validated to avoid generating unhandled exceptions.

/packages/contracts/contracts/Dependencies/EbtcMath.sol

  • L78/98/116 - There is commented code that should be eliminated to avoid confusion and generate unnecessary lines.

/packages/contracts/contracts/LiquidationLibrary.sol

  • L555/558/579 - Divisions are made by the input _price and it is not validated if the value is != 0, therefore it should be previously validated so as not to generate unhandled exceptions.

/packages/contracts/contracts/EBTCToken.sol

  • L209/210 - abi.encodePacked() should not be used with dynamic types when passing the result to a hash function such as keccak256() Use abi.encode() instead which will pad items to 32 bytes, which will prevent hash collisions (e.g. abi.encodePacked(0x123,0x456) => 0x123456 => abi.encodePacked(0x1,0x23456), but abi.encode(0x123,0x456) => 0x0...1230...456). “Unless there is a compelling reason, abi.encode should be preferred”. If there is only one argument to abi.encodePacked() it can often be cast to bytes() or bytes32() instead. If all arguments are strings and or bytes, bytes.concat() should be used instead.

/packages/contracts/contracts/BorrowerOperations.sol

  • L717/718 - abi.encodePacked() should not be used with dynamic types when passing the result to a hash function such as keccak256() Use abi.encode() instead which will pad items to 32 bytes, which will prevent hash collisions (e.g. abi.encodePacked(0x123,0x456) => 0x123456 => abi.encodePacked(0x1,0x23456), but abi.encode(0x123,0x456) => 0x0...1230...456). “Unless there is a compelling reason, abi.encode should be preferred”. If there is only one argument to abi.encodePacked() it can often be cast to bytes() or bytes32() instead. If all arguments are strings and or bytes, bytes.concat() should be used instead.

#0 - c4-pre-sort

2023-11-17T14:46:22Z

bytes032 marked the issue as insufficient quality report

#1 - c4-judge

2023-11-27T10:01:49Z

jhsagd76 marked the issue as grade-b

#2 - jhsagd76

2023-12-08T06:41:43Z

3N

1L

B

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter