Platform: Code4rena
Start Date: 13/11/2023
Pot Size: $24,500 USDC
Total HM: 3
Participants: 120
Period: 4 days
Judge: 0xTheC0der
Id: 306
League: ETH
Rank: 48/120
Findings: 1
Award: $19.04
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: 0xSmartContract
Also found by: 0xbrett8571, 0xepley, Bauchibred, K42, Kose, MrPotatoMagic, Myd, Sathish9098, aariiif, cats, clara, emerald7017, fouzantanveer, hunter_w3b, invitedtea, unique
19.0443 USDC - $19.04
The Application Specific Dollar (asD) protocol allows for individuals to generate stablecoins (pegged at 1 NOTE) while enabling creators to collect all generated yields.
1155tech, an art protocol, plans to adopt asD as its primary currency. Differing from current bonding curve protocols, users have the option to pay a fee for minting ERC1155 tokens based on their ownership stakes. Although these ERC1155 tokens don't yield trading fees, they are tradable on secondary markets and usable in contexts where ERC1155 tokens are accepted (such as for profile images).
Each asD is consistently backed at a 1:1 ratio to NOTE. The NOTE is integrated into the Canto Lending Market, allowing the creator of a coin to withdraw accumulated interest (the carry) whenever desired.
The contracts use the following 2 access control modifiers for different mechanisms within the system:
onlyOwner
: Used for the administrative functions within the system that have to do with whitelisting bonding curves, claiming platform fees, restricting shares creation and whitelisting share creators.onlyShareCreator
: Used only for share creation.onlyOwner
: This role has access to administrative functions such as whitelisting bonding curves, claiming platform fees, restricting shares creation, as well as whitelisting share creators.onlyShareCreator
: This role has access to a single function responsible for share creation.Market: The Market contract is a critical part of the Canto system. It keeps count of many important variables ranging from share data
and whitelisted bonding curves
to unclaimed platform funds
and the different BPS fees
. It also contains functions for buying and selling tokens, minting and burning NFTs and more.
LinearBondingCurve: The LinearBondingCurve contract is small but immensely important as it contains crucial logic related to the Bonding Curve
strategy, information about how much the price increases per share, as well as various getter functions.
asDFactory: The asDFactory contract is tasked with generating application-specific dollars contracts. Not too much to elaborate on this contract.
asD: The asD contract is generated by the asDFactory contract and is the actual application-specific dollar contract. It contains functionality for minting asD Tokens
by providing NOTE
or burning asD Tokens
for getting NOTE
back. Also includes a function restricted for the onlyOwner
role to withdraw acrrued interest.
The architecture diagram visualizes how the contracts in the system interact with eachother and provides short descriptions of the contracts' intended mechanism.
The flow of funds diagram visualizes the process through which a user goes in order to deposit their assets into the protocol and how they complete their cycle within the ecosystem.
Although the total codebase in scope is very small, my observations were that everything was put solidly in place. There were no unnecessary complications that would allow for more attack vectors to arise neither were functions simpler than they needed to be. I believe the developers did a particularly excellent on the codebase with the natspec and in-line comments that were scattered all around the contracts, easing in auditors, or anyone reading the code, to quickly understand each contract and its mechanics. Readability was maintained and coding style was pleasant to read.
The documentation provided in the github repo was extensive and it contained detailed explanations on the different nuances and mechanisms of the system in scope. There was also a link to more detailed documentation containing a ton of additional information. Overall great documentation both in the repo and their official docs.
The codebase is remarkably small. I don't have too much ideas to elaborate on the systemic risks as I was not able to find anything myself. Given that this marks the inaugural audit for the protocol, it wouldn't be unexpected if a few bugs surface. I am confident that other auditors will likely discover additional areas for improvement!
I am particularly pleased to conclude that there seem to be no centralization risks whatsoever. Well.. that is expected when there's not many functions to call in the first place anyway - but that is not the point. The few functions that were locked behind role-specific access control modifiers were some important administrative functions like whitelisting and claiming protocol fees. So as far as centralization risks - I don't see any and the protocol did a fantastic job.
Severity | Findings |
---|---|
Critical | 0 |
High | 0 |
Medium | 0 |
Low | 0 |
Start Date | 15.11.2023 |
End Date | 17.11.2023 |
Days spent | 3 Days |
Hours | 20h |
20 hours
#0 - c4-judge
2023-11-29T20:31:27Z
MarioPoneder marked the issue as grade-b