Joyn contest - z3s's results

Launchpad for collaborative web3 media projects with blueprints, building blocks, and community support.

General Information

Platform: Code4rena

Start Date: 30/03/2022

Pot Size: $30,000 USDC

Total HM: 21

Participants: 38

Period: 3 days

Judge: Michael De Luca

Total Solo HM: 10

Id: 104

League: ETH

Joyn

Findings Distribution

Researcher Performance

Rank: 28/38

Findings: 2

Award: $114.18

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Awards

72.7457 USDC - $72.75

Labels

bug
QA (Quality Assurance)

External Links

Non Critical

Use of Floating Pragma:

Contracts should be deployed with the same compiler version and flags that they have been tested with thoroughly. Locking the pragma helps to ensure that contracts do not accidentally get deployed using, for example, an outdated compiler version that might introduce bugs that affect the contract system negatively.

Lock the pragma version: use 0.8.9 instead of ^0.8.0.

Delete unused imports:

Having unused imports make confusion.

Code Style: non-constant should not be named in upper-case:

Non-constant (especially public) variables should not be in SNAKE_CASE, or they may be misunderstood as constants. Consider changing to camelCase. https://github.com/code-423n4/2022-03-joyn/blob/main/core-contracts/contracts/CoreCollection.sol#L27 it's value can be changed in: https://github.com/code-423n4/2022-03-joyn/blob/main/core-contracts/contracts/CoreCollection.sol#L209

Redundant == true in require:

transfer return boolean and require expect a boolean. so these == true can be deleted: https://github.com/code-423n4/2022-03-joyn/blob/main/royalty-vault/contracts/RoyaltyVault.sol#L44 https://github.com/code-423n4/2022-03-joyn/blob/main/royalty-vault/contracts/RoyaltyVault.sol#L48 https://github.com/code-423n4/2022-03-joyn/blob/main/royalty-vault/contracts/RoyaltyVault.sol#L55

Low Risks

Use better reentrancy attack prevention method than gas limit:

https://github.com/code-423n4/2022-03-joyn/blob/main/splits/contracts/Splitter.sol#L255 As mentioned in comments this can lead to limited reentrancy attack. use openzeppelin reentrancyguard here. this internal function it's not used yet in other parts of code. but use a reentrancy attack prevention method when you going to use it.

#0 - sofianeOuafir

2022-04-15T16:04:24Z

high quality report

Findings Information

Awards

41.43 USDC - $41.43

Labels

bug
G (Gas Optimization)

External Links

Gas Optimizations

Saving some SLOADs in sendToSplitter():

https://github.com/code-423n4/2022-03-joyn/blob/main/royalty-vault/contracts/RoyaltyVault.sol#L31 cache splitterProxy, royaltyAsset, platformFeeRecipient in sendToSplitter(). each direct read of state vars cost 100 gas.

Use calldata instead of memory in createProject():

https://github.com/code-423n4/2022-03-joyn/blob/main/core-contracts/contracts/CoreFactory.sol#L72

For external function's dynamic params, calldata is the cheapest location to use.

Change params memory to calldata

Use Custom Errors to save Gas:

Custom errors from Solidity 0.8.4 are cheaper than require messages. https://blog.soliditylang.org/2021/04/21/custom-errors/

++i use less gas than i++:

https://github.com/code-423n4/2022-03-joyn/blob/main/core-contracts/contracts/CoreCollection.sol#L279 https://github.com/code-423n4/2022-03-joyn/blob/main/core-contracts/contracts/CoreFactory.sol#L79 https://github.com/code-423n4/2022-03-joyn/blob/main/splits/contracts/Splitter.sol#L50 https://github.com/code-423n4/2022-03-joyn/blob/main/splits/contracts/Splitter.sol#L274

Redundant == true in require:

transfer return boolean and require expect a boolean. so removing these == true can save some gas: https://github.com/code-423n4/2022-03-joyn/blob/main/royalty-vault/contracts/RoyaltyVault.sol#L44 https://github.com/code-423n4/2022-03-joyn/blob/main/royalty-vault/contracts/RoyaltyVault.sol#L48 https://github.com/code-423n4/2022-03-joyn/blob/main/royalty-vault/contracts/RoyaltyVault.sol#L55

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