Introduction
We express our gratitude to the Societe Generale Forge (SG Forge) team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
CoinVertible EURCV is an institutional-grade stablecoin with full transparency issued by Societe Generale - Forge.
| title | content |
|---|---|
| Platform | Ethereum |
| Language | Solidity |
| Tags | ERC20 token, StableCoin |
| Timeline | 01/10/2023 - 16/10/2023 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
|---|---|
| Repository | Zip file |
| Commit | dab4c9e |
Review Scope
- Repository
- Zip file
- Commit
- dab4c9e
Audit Summary
5/10
100%
10/10
100/10
The system users should acknowledge all the risks summed up in the risks section of the report
Document Information
This report may contain confidential information about IT systems and the intellectual property of the Customer, as well as information about potential vulnerabilities and methods of their exploitation.
The report can be disclosed publicly after prior consent by another Party. Any subsequent publication of this report shall be without mandatory consent.
Document | |
|---|---|
| Name | Smart Contract Code Review and Security Analysis Report for Societe Generale Forge (SG Forge) |
| Audited By | Hacken |
| Website | https://www.sgforge.com/→ |
| Changelog | 03/10/2023 – Initial Review |
| 16/10/2023 - Second Review |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for Societe Generale Forge (SG Forge)
- Audited By
- Hacken
- Website
- https://www.sgforge.com/→
- Changelog
- 03/10/2023 – Initial Review
- 16/10/2023 - Second Review
System Overview
SMART_COIN is an ERC20 stablecoin pegged to the Euro, with the following contracts:
SmartCoin — ERC20 extended with: \-UUPS upgrade mechanism. \-Operator Roles: registrar, operations, technical. These roles are introduced to manage the upgrade to new implementations and control transfers of tokens amongst these roles.
WhitelistUpgradeable — the contract, which: \-Manages the 3 roles: sets and holds their addresses, includes roles’ modifiers. \-Manages the whitelist: adds/removes addresses, and includes whitelist modifiers. \-Manages new implementations: authorizes implementation, names new implementation operators, and allows operators to accept the new roles.
WhitelistDataLayout - the contract contains the storage part of the WhitelistUpgradeable contract, and stores the data of the new implementation contract: its address and the addresses of new roles. Furthermore, it stores the whitelisted users.
SmartCoinDataLayout - the contract, which contains the storage part of the SmartCoin contract.
EncodingUtils - a library that has the functionality to compute the hash of transfer requests
Privileged roles
Registrar operator:
Manages Whitelist of authorized users.
Validates/Rejects transfers to registrar and operations operators.
Names the operators for the new implementation.
Authorizes the upgrade to the next implementation.
Cannot be used as spender or destination of
transferFrom().Can retrieve tokens from any address to itself.
Can mint and burn SmartCoin tokens.
Operations operator:
Used when token owners want to sell the SmartCoin tokens to the issuer in exchange for cash.
Cannot be used as spender or destination of
transferFrom().Transfers to operations must be validated by the registrar.
Technical operator:
Launches a previously authorized (by registrar) implementation upgrade.
Executive Summary
Documentation quality
The total Documentation quality score is 10 out of 10.
Functional requirements are provided.
Technical specification is provided.
NatSpec is sufficient.
Code quality
The total Code quality score is 10 out of 10.
The development environment is configured.
Deployment instructions are provided.
Test coverage
Code coverage of the project is 100% (branch coverage).
Deployment and basic user interactions are covered with tests.
Negative cases coverage is covered.
Interactions by several users are tested thoroughly.
Security score
Upon auditing, the code was found to contain 0 critical, 1 high, 0 medium, and 2 low severity issues. Out of these, 2 issues have been addressed and resolved, leading to a security score of 5 out of 10.
All identified issues are detailed in the “Findings” section of this report.
Summary
The comprehensive audit of the customer's smart contract yields an overall score of 6.5. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
Risks
The SmartCoin contract is upgradeable, which means that the contract logic can be changed by the protocol owners at any time. The users should be aware of this fact when interacting with Upgradeable Contracts.
The protocol uses a whitelisting method in order to control the users who can transfer the SmartCoin tokens. This means that users’ tokens can become locked in their wallets if they are removed from the whitelist while holding tokens.
The stablecoin supply is managed as explained in section 4 of the WhitePaper →, although being a centralized protocol the users must trust the owners to keep manage peg EUR-EURCV and manage the collateral correctly.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2023-1034 | Highly Permissive Role Allows Access To Users Funds | accepted | High | |
| F-2023-1036 | Multiple Roles Can Be Set For A Single Address | fixed | Low | |
| F-2023-1035 | Missing Zero Address Validation | fixed | Low | |
| I-2023-0281 | EngagedAmount Collection Processing Lacks Consistency | fixed | Observation | |
| I-2023-028 | State Variables In Upgradeable Contracts Should Be In Initializer | mitigated | Observation | |
| I-2023-0279 | Missing Initialization Calls To Parent Contracts | fixed | Observation | |
| I-2023-0278 | Missing SPDX License Identifier | fixed | Observation | |
| I-2023-027 | Variable Shadowing as Improper Coding Standard | fixed | Observation | |
| I-2023-0276 | Style Guide Violation: Order Of Layout | fixed | Observation |
Appendix 1. Severity Definitions
When auditing smart contracts, Hacken is using a risk-based approach that considers Likelihood, Impact, Exploitability and Complexity metrics to evaluate findings and score severities.
Reference on how risk scoring is done is available through the repository in our Github organization:
Severity | Description |
|---|---|
Critical | Critical vulnerabilities are usually straightforward to exploit and can lead to the loss of user funds or contract state manipulation. |
High | High vulnerabilities are usually harder to exploit, requiring specific conditions, or have a more limited scope, but can still lead to the loss of user funds or contract state manipulation. |
Medium | Medium vulnerabilities are usually limited to state manipulations and, in most cases, cannot lead to asset loss. Contradictions and requirements violations. Major deviations from best practices are also in this category. |
Low | Major deviations from best practices or major Gas inefficiency. These issues will not have a significant impact on code execution, do not affect security score but can affect code quality score. |
Severity
- Critical
Description
- Critical vulnerabilities are usually straightforward to exploit and can lead to the loss of user funds or contract state manipulation.
Severity
- High
Description
- High vulnerabilities are usually harder to exploit, requiring specific conditions, or have a more limited scope, but can still lead to the loss of user funds or contract state manipulation.
Severity
- Medium
Description
- Medium vulnerabilities are usually limited to state manipulations and, in most cases, cannot lead to asset loss. Contradictions and requirements violations. Major deviations from best practices are also in this category.
Severity
- Low
Description
- Major deviations from best practices or major Gas inefficiency. These issues will not have a significant impact on code execution, do not affect security score but can affect code quality score.
Appendix 2. Scope
The scope of the project includes the following smart contracts from the provided repository: