Backed Protocol contest - Tomio's results

Protocol for peer to peer NFT-Backed Loans.

General Information

Platform: Code4rena

Start Date: 05/04/2022

Pot Size: $30,000 USDC

Total HM: 10

Participants: 47

Period: 3 days

Judge: gzeon

Total Solo HM: 4

Id: 106

League: ETH

Backed Protocol

Findings Distribution

Researcher Performance

Rank: 45/47

Findings: 1

Award: $42.14

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

42.1423 USDC - $42.14

Labels

bug
G (Gas Optimization)
sponsor acknowledged

External Links

  1. Using < is cheaper than <=

Proof of Concept: https://github.com/code-423n4/2022-04-backed/blob/main/contracts/NFTLoanFacilitator.sol#L146-L148 https://github.com/code-423n4/2022-04-backed/blob/main/contracts/NFTLoanFacilitator.sol#L171-L172

Recommended Mitigation Steps: Change from <= to <

require(interestRate < loan.perAnumInterestRate, 'NFTLoanFacilitator: rate too high');

========================================================================

  1. !=0 is more gas efficient than < 0

Proof of Concept: https://github.com/code-423n4/2022-04-backed/blob/main/contracts/NFTLoanFacilitator.sol#L198 https://github.com/code-423n4/2022-04-backed/blob/main/contracts/NFTLoanFacilitator.sol#L321

Recommended Mitigation Steps: Change > 0 or < 0 to != 0

========================================================================

  1. Using calldata to store struct data type can save gas

Proof of Concept: https://github.com/code-423n4/2022-04-backed/blob/main/contracts/NFTLoanFacilitator.sol#L332

Recommended Mitigation Steps: Change to:

function loanInfoStruct(uint256 loanId) external view override returns (Loan calldata) {

========================================================================

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