AbraNFT contest - MaratCerby's results

A peer to peer lending platform, using NFTs as collateral.

General Information

Platform: Code4rena

Start Date: 27/04/2022

Pot Size: $50,000 MIM

Total HM: 6

Participants: 59

Period: 5 days

Judge: 0xean

Id: 113

League: ETH

Abracadabra Money

Findings Distribution

Researcher Performance

Rank: 35/59

Findings: 1

Award: $111.21

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

111.2113 MIM - $111.21

Labels

bug
QA (Quality Assurance)
sponsor disputed

External Links

Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPair.sol#L545

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_REPAY = 2;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPair.sol#L546

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_REMOVE_COLLATERAL = 4;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPair.sol#L548

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_REQUEST_LOAN = 12;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPair.sol#L549

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_LEND = 13;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPair.sol#L552

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_BENTO_DEPOSIT = 20;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPair.sol#L553

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_BENTO_WITHDRAW = 21;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPair.sol#L554

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_BENTO_TRANSFER = 22;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPair.sol#L555

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_BENTO_TRANSFER_MULTIPLE = 23;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPair.sol#L556

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_BENTO_SETAPPROVAL = 24;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPair.sol#L559

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_CALL = 30;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPair.sol#L562

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_REQUEST_AND_BORROW = 40;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPair.sol#L563

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_TAKE_COLLATERAL_AND_LEND = 41;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPair.sol#L565

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: int256 constant USE_VALUE1 = -1;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPair.sol#L566

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: int256 constant USE_VALUE2 = -2;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPairWithOracle.sol#L578

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_REPAY = 2;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPairWithOracle.sol#L579

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_REMOVE_COLLATERAL = 4;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPairWithOracle.sol#L581

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_REQUEST_LOAN = 12;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPairWithOracle.sol#L582

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_LEND = 13;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPairWithOracle.sol#L585

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_BENTO_DEPOSIT = 20;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPairWithOracle.sol#L586

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_BENTO_WITHDRAW = 21;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPairWithOracle.sol#L587

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_BENTO_TRANSFER = 22;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPairWithOracle.sol#L588

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_BENTO_TRANSFER_MULTIPLE = 23;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPairWithOracle.sol#L589

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_BENTO_SETAPPROVAL = 24;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPairWithOracle.sol#L592

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_CALL = 30;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPairWithOracle.sol#L595

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_REQUEST_AND_BORROW = 40;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPairWithOracle.sol#L596

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: uint8 constant ACTION_TAKE_COLLATERAL_AND_LEND = 41;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPairWithOracle.sol#L598

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: int256 constant USE_VALUE1 = -1;


Impact

By default state variables/constants are internal. Internal keyword can be omitted. Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPairWithOracle.sol#L599

Proof of Concept

https://docs.soliditylang.org/en/v0.8.12/types.html#:~:text=to%20be%20omitted.-,By,-default%2C%20function%20types

Tools Used

Recommended code: int256 constant USE_VALUE2 = -2;


Impact

uint8 is assigned to zero by default, additional reassignment to zero is unnecessary Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPair.sol#L96

Proof of Concept

https://docs.soliditylang.org/en/v0.8.13/control-structures.html#default-value

Tools Used

Recommended code: uint8 private constant LOAN_INITIAL;


Impact

uint256 is assigned to zero by default, additional reassignment to zero is unnecessary Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPair.sol#L641

Proof of Concept

https://docs.soliditylang.org/en/v0.8.13/control-structures.html#default-value

Tools Used

Recommended code: uint256 i;


Impact

uint8 is assigned to zero by default, additional reassignment to zero is unnecessary Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPairWithOracle.sol#L113

Proof of Concept

https://docs.soliditylang.org/en/v0.8.13/control-structures.html#default-value

Tools Used

Recommended code: uint8 private constant LOAN_INITIAL;


Impact

uint256 is assigned to zero by default, additional reassignment to zero is unnecessary Affected code: https://github.com/code-423n4/2022-04-abranft/tree/main/contracts/NFTPairWithOracle.sol#L674

Proof of Concept

https://docs.soliditylang.org/en/v0.8.13/control-structures.html#default-value

Tools Used

Recommended code: uint256 i;


#0 - cryptolyndon

2022-05-12T04:09:35Z

Matter of choice. I prefer to explicitly initialize variables for readability, even if they get the default. As it happens I'm less attached to the "internal" but at the end of the day that is also subjective and I can see a case for it.

If there is something else in there, I missed it because of the tedious delivery method chosen, and am disputing it on general principle.

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