Platform: Code4rena
Start Date: 11/12/2023
Pot Size: $90,500 USDC
Total HM: 29
Participants: 127
Period: 17 days
Judge: TrungOre
Total Solo HM: 4
Id: 310
League: ETH
Rank: 73/127
Findings: 1
Award: $114.88
π Selected for report: 0
π Solo Findings: 0
π Selected for report: Sathish9098
Also found by: 0xSmartContract, 14si2o_Flint, JayShreeRAM, Myd, SBSecurity, beber89, hunter_w3b, invitedtea, pavankv
114.8801 USDC - $114.88
# | Topic |
---|---|
1 | Architecture Overview (Protocol Explanation, Codebase Explanation, Examples Scenarios of Intended Protocol Flow) |
2 | Codebase Quality Analysis |
3 | Centralization Risks |
4 | Systemic Risks |
5 | Attack Vectors Discussed During the Audit |
Overview:
The Ethereum Credit Guild (ECG) represents an innovative approach in the realm of decentralized finance, building upon the foundations laid by Volt Protocol. The primary aim of ECG is to establish a credibly neutral and censorship-resistant system for savings and credit. This objective is pursued through a distinctive mechanism which centralizes all minting activities within a Collateralized Debt Position (CDP)/debt issuance model. Notably, this model operates with ephemeral loan terms and does not depend on external trusted oracles..
Smart Contract Infrastructure:
ProfitManager.sol
: Manages the distribution of profits within the system, integrating with CoreRef, CoreRoles, SimplePSM, GuildToken, and CreditToken. Central to the governance of profit distribution among various stakeholders.GuildTimelockController.sol
: An enhanced version of OpenZeppelin's TimelockController, tailored for uniform access control in the Ethereum Credit Guild system. Integrates with CoreRef and CoreRoles, ensuring a robust governance framework.GuildGovernor.sol
: Implements the governance structure of the ecosystem, extending various OpenZeppelin contracts like Governor and GovernorSettings. A comprehensive solution for governance, interfacing with multiple extensions for flexibility and control.CoreRoles.sol
: Defines the array of roles within the Ethereum Credit Guild ecosystem, essential for access control and orderly governance. Acts as a central reference for role management and security protocols.AuctionHouse.sol
: Manages the auction of borrowers' collateral to cover credit debts. Integrates tightly with CoreRef and CoreRoles, playing a critical role in the financial stability of the system.LendingTerm.sol
: Sets and manages lending terms within the ecosystem. Utilizes core contracts like IERC20 and SafeERC20, indicating its pivotal role in defining lending parameters.SimplePSM.sol
: A key component in the loan system, possibly involved in loan management or financial operations. Interacts with several contracts, including ERC20, SafeERC20, CoreRef, CoreRoles, and CreditToken, demonstrating its integration in financial and governance aspects.SurplusGuildMinter.sol
: Handles minting operations related to surplus funds in the guild. Integrates with SafeCastLib, CoreRef, CoreRoles, GuildToken, and CreditToken, highlighting its importance in financial management and minting operations.Roles in Ethereum Credit Guild:
GOVERNOR
: The all-powerful role that controls all other roles and protocol functionality.GUARDIAN
: The protector role, responsible for pausing contracts and revoking roles in an emergency.CREDIT_MINTER
: Can mint CREDIT tokens arbitrarily, providing significant control over the token supply.RATE_LIMITED_CREDIT_MINTER
: Allowed to mint CREDIT within specific rate limits and caps, ensuring controlled token issuance.GUILD_MINTER
: Authorized to mint GUILD tokens arbitrarily, similar to the CREDIT_MINTER role but specific to GUILD tokens.RATE_LIMITED_GUILD_MINTER
: Can mint GUILD tokens within predetermined rate limits and caps, managing the supply responsibly.GAUGE_ADD
: Empowered to add new gauges to the system, influencing the way rewards or metrics are calculated.GAUGE_REMOVE
: Can remove gauges from the system, affecting the operational dynamics of gauging mechanisms.GAUGE_PARAMETERS
: Responsible for managing gauge parameters like max gauges and individual caps.GAUGE_PNL_NOTIFIER
: Notifies about profits and losses in a given gauge, playing a critical role in financial reporting and analysis.CREDIT_MINTER
role in CoreRoles.sol
suggests a controlled and potentially rate-limited minting process.LendingTerm.sol
and CreditToken.sol
.Additional Explanations Related to Credit Issuance
:
CreditToken.sol
contract likely represents the ERC20 token for CREDIT.RateLimitedMinter.sol
may impose limits on how much CREDIT can be minted, ensuring sustainable and responsible credit issuance.GuildGovernor.sol
enables governance decisions, likely involving token holders voting on various proposals.GUARDIAN
role in CoreRoles.sol
is designed for emergency interventions, such as pausing contracts or revoking roles.Additional Explanations Related to Governance
:
ERC20MultiVotes.sol
might be employed for sophisticated voting mechanisms in governance.GuildTimelockController.sol
suggests a time-delayed execution of governance decisions, enhancing security and stability.ProfitManager.sol
contract oversees the distribution of profits generated within the system.ERC20Gauges.sol
and ERC20RebaseDistributor.sol
might be involved in managing yield-generating strategies or distributing rewards.Additional Explanations Related to Profit and Yield
:
ERC20Gauges.sol
, could measure and distribute rewards based on different metrics or user activities.GuildToken.sol
might represent a token that benefits from these yield-generating activities or profit distributions.ProfitManager.sol
:
Code Organization:
Modifiers:
Profit Management:
Gas Efficiency:
Overall, ProfitManager.sol
is well-crafted with a focus on security, modularity, and gas efficiency, underlining its crucial role in the Ethereum Credit Guild ecosystem.
GuildTimelockController.sol
:
Code Organization:
Timelock Mechanism:
Security:
Overall, GuildTimelockController.sol
presents a secure and well-organized approach to implementing timelock functionality in the governance process, contributing to the protocol's stability and trustworthiness.
AuctionHouse.sol
:
Code Organization:
Auction Mechanism:
Security and Efficiency:
Overall, AuctionHouse.sol
is a well-designed contract that plays a key role in the financial health of the Ethereum Credit Guild, showcasing strong code organization and a focus on security and efficiency.
In the Ethereum Credit Guild (ECG), similar to the Ethena
Protocol example, the system assigns critical roles and responsibilities to specific entities, which introduces potential centralization risks. These roles, while necessary for the protocol's functionality, can become points of vulnerability if compromised.
CREDIT_MINTER
, GUARDIAN
, and GOVERNOR
hold substantial power over the protocol's operations. A compromised role, especially a CREDIT_MINTER
, could lead to unauthorized minting of tokens, potentially destabilizing the ecosystem.GAUGE_PARAMETERS
or RATE_LIMITED_GUILD_MINTER
could become single points of failure if their control is centralized, leading to potential manipulation or mismanagement.GATEKEEPERS
, which can intervene in suspicious activities, adds a layer of security. These roles should be distributed across different entities to avoid centralization.While the Ethereum Credit Guild introduces several centralization risks due to the allocation of significant powers to certain roles, the implementation of effective mitigation strategies can minimize these risks. These include setting transaction limits, dece
Hereβs an analysis of potential systemic risks for the Ethereum Credit Guild:
Third-Party Dependency Risk:
"dependencies": { "@openzeppelin/contracts-upgradeable": "latest_version" }
The Ethereum Credit Guild, like any complex smart contract system, is susceptible to various attack vectors. During the audit process, particular attention should be paid to the following potential vulnerabilities:
Issues related to Roles (Centralization Risks):
CREDIT_MINTER
or GUARDIAN
, are critical. Improper handling or changing of these roles can introduce centralization risks and potential for misuse.Breaking of Main Protocol Invariants:
ProfitManager.sol
or GuildToken.sol
must adhere strictly to their intended logic. Any deviation from expected behavior could compromise the system's integrity. For example, tokens should only be minted or burned under defined conditions.DoS for Important Protocol Functions/Flows:
AuctionHouse.sol
or SimplePSM.sol
can't be easily disrupted.Token Transfer Fails:
Minting More Than Prescribed Limits Per Block:
Challenges in Unstaking/Withdrawing/Redeeming:
Unauthorized Withdrawals:
Minting Without Adequate Collateral:
LendingTerm.sol
, should always require the appropriate collateral. Minting without or with insufficient collateral could severely undermine the token's value and trust.By addressing these attack vectors, the Ethereum Credit Guild can enhance its security and robustness, ensuring a more secure and stable platform for its users.
35 hours
35 hours
#0 - c4-pre-sort
2024-01-05T17:38:01Z
0xSorryNotSorry marked the issue as insufficient quality report
#1 - c4-judge
2024-01-31T04:55:05Z
Trumpero marked the issue as grade-b