LUKSO - K42's results

Provides creators and users with future-proof tools and standards to unleash their creative force in an open interoperable ecosystem.

General Information

Platform: Code4rena

Start Date: 30/06/2023

Pot Size: $100,000 USDC

Total HM: 8

Participants: 22

Period: 14 days

Judge: Trust

Total Solo HM: 6

Id: 253

League: ETH

LUKSO

Findings Distribution

Researcher Performance

Rank: 5/22

Findings: 1

Award: $2,034.26

Analysis:
grade-a

🌟 Selected for report: 1

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: K42

Also found by: catellatech, gpersoon

Labels

analysis-advanced
grade-a
high quality report
satisfactory
selected for report
sponsor confirmed
A-01

Awards

2034.2593 USDC - $2,034.26

External Links

Advanced Analysis Report for LUKSO

Overview

  • LUKSO is a blockchain ecosystem specifically created for the lifestyle industry, providing a decentralized innovation and trust infrastructure for fashion brands, start-ups, and customers. It offers various standards and features, including digital identities, certificates, and various forms of digital ownership and assets.

Understanding the Ecosystem:

LUKSO'S ecosystem is built around various standards and modules, including:

  • ERC725: A smart contract standard that includes two main components, ERC725X and ERC725Y, which provide a generic executor contract and a generic data key-value store, respectively.
  • LSP0ERC725Account: An advanced smart contract-based account that offers a comprehensive range of essential features, including a generic bytes32 => bytes data key-value store, a generic execution medium, signature validation via ERC1271, a universal function (LSP1 universalReceiver(bytes32,bytes)) to be notified about different actions and information, extensibility via LSP17, secure ownership management module (LSP14), and direct execution through the contract itself using the LSP20 standard.
  • LSP1UniversalReceiver and LSP1UniversalReceiverDelegate: Standards designed to facilitate a universally standardized way of receiving notifications about various actions.
  • LSP6KeyManager: A smart contract that acts as a controller for another contract it is linked to, enabling the linked contract to be controlled by multiple addresses.
  • LSP4DigitalAssetMetadata, LSP7DigitalAsset, and LSP8IdentifiableDigitalAsset: Token standards that define fungible and non-fungible tokens, respectively, and include a flexible data key-value store via LSP4.
  • LSP14Ownable2Step: An advanced ownership module designed to give a more precise and safer way to manage contract ownership.
  • LSP17ContractExtension: A standard designed to extend a contract's functionality post-deployment.
  • LSP20CallVerification: An innovative module that simplifies access control rules verification within smart contracts.

Codebase Quality Analysis:

  • The LUKSO codebase is well-structured and follows best practices for smart contract development. It is modular, with each standard and feature implemented in separate contracts. This modular design makes the codebase easier to navigate and understand, and it also allows for more efficient testing and auditing.

  • The contracts are well-documented, with clear comments explaining the purpose and functionality of each function and module. This level of documentation is crucial for understanding the intended behaviour of the contracts and for identifying any potential discrepancies between the implementation and the intended behaviour.

  • The codebase also includes comprehensive tests, which is a positive indicator of code quality. These tests cover various scenarios and edge cases, helping to ensure that the contracts behave as expected in a wide range of situations.

Architecture Recommendations:

The architecture of the LUKSO ecosystem is well-designed, with clear separation of concerns and modular components. However, there are a few areas where improvements could be made:

  • Implementing a more robust system for managing permissions: The current system, while flexible, could potentially be exploited if a controller is granted overlapping permissions. A more robust system could include checks to prevent such overlaps.
  • Improving gas efficiency: Some functions, such as the transferBatch(...) function in the LSP7 and LSP8 standards, could be optimized for gas efficiency.
  • Adding more functionality to the LSP6KeyManager: Currently, the executeBatch(..) function is not supported, and the relayer can choose the amount of gas provided when interacting with the executeRelayCall(...) functions. Adding support for batch execution and more control over gas provision could improve the functionality and usability of the KeyManager.

Centralization Risks:

  • The LUKSO ecosystem is designed to be decentralized, with multiple controllers able to manage a contract and various standards for decentralized ownership and execution. However, there are potential centralization risks, particularly if a single controller is granted multiple permissions. This could potentially allow the controller to bypass required permissions or lock the account. To mitigate these risks, it would be beneficial to implement additional checks and balances in the permission management system.

Mechanism Review:

  • The mechanisms implemented in the LUKSO ecosystem, including the ERC725 standard, the LSP standards, and the various modules for ownership management, execution, and extension, are innovative and well-designed. They provide a comprehensive range of features and capabilities, enabling a wide range of use cases in the lifestyle industry.

  • However, there are some potential issues and risks associated with these mechanisms. For example, the LSP1UniversalReceiverDelegate could potentially be used to register spam assets, and the LSP14Ownable2Step module could potentially be exploited if the current owner is a contract that implements LSP1. These issues should be carefully considered and mitigated to ensure the security and reliability of the ecosystem.

Systemic Risks:

  • The systemic risks in the LUKSO ecosystem primarily relate to the potential for permission overlap and the potential for spamming or exploitation of the LSP1UniversalReceiverDelegate. These risks could potentially be mitigated through more robust permission management and additional checks and balances in the LSP1UniversalReceiverDelegate.

Areas of Concern

  • The main areas of concern in the LUKSO ecosystem relate to permission management, gas efficiency, and potential exploitation of the LSP1UniversalReceiverDelegate and LSP14Ownable2Step modules. These issues should be addressed to ensure the security, efficiency, and reliability of the ecosystem.

Codebase Analysis

  • The LUKSO codebase is well-structured, well-documented, and includes comprehensive tests. However, there are areas where improvements could be made, particularly in terms of gas efficiency and permission management.

Recommendations

To improve the LUKSO ecosystem, the following recommendations could be considered:

  • Implement a more robust system for managing permissions to prevent potential overlaps and exploitation.
  • Optimize functions for gas efficiency, particularly the transferBatch(...) function in the LSP7 and LSP8 standards.
  • Implement additional checks and balances in the LSP1UniversalReceiverDelegate to prevent potential spamming or exploitation.
  • Add more functionality to the LSP6KeyManager, such as support for batch execution and more control over gas provision.

Contract Details

  • The LUKSO ecosystem includes a wide range of contracts implementing various standards and features. These contracts are well-documented and include comprehensive tests, indicating a high level of code quality.

Conclusion

  • The LUKSO ecosystem is a well-designed and innovative platform for the lifestyle industry, offering a wide range of features and capabilities. However, there are areas where improvements could be made, particularly in terms of permission management, gas efficiency, and potential exploitation of certain modules. By addressing these issues, the LUKSO ecosystem could become even more secure, efficient, and reliable.

Time spent:

20 hours

#0 - c4-pre-sort

2023-07-17T22:54:53Z

minhquanym marked the issue as high quality report

#1 - c4-sponsor

2023-07-28T08:32:47Z

CJ42 marked the issue as sponsor confirmed

#2 - CJ42

2023-07-28T08:43:49Z

Good feedbacks and analysis provided overall. Some of this content might be useful, and we consider including it in our docs.

Improving gas efficiency: Some functions, such as the transferBatch(...) function in the LSP7 and LSP8 standards, could be optimized for gas efficiency.

Adding more functionality to the LSP6KeyManager: Currently, the executeBatch(..) function is not supported, and the relayer can choose the amount of gas provided when interacting with the executeRelayCall(...) functions. Adding support for batch execution and more control over gas provision could improve the functionality and usability of the KeyManager.

These are things that we consider adding in the future. It is in our roadmap.

Regarding the risks reported, these will be considered and investigated in the future.

#3 - c4-judge

2023-08-02T09:53:42Z

trust1995 marked the issue as grade-a

#4 - c4-judge

2023-08-02T09:53:48Z

trust1995 marked the issue as satisfactory

#5 - c4-judge

2023-08-02T12:10:30Z

trust1995 marked the issue as selected for report

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