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: 51/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
I thoroughly examined the provided Solidity contracts—Market.sol, LinearBondingCurve.sol, asD.sol, and asDFactory.sol. My evaluation involved scrutinizing the code structure, identifying potential security flaws, and considering adherence to best practices. I focused on understanding the functionality of each contract, potential vulnerabilities, and the overall security architecture.
Market.sol:
LinearBondingCurve.sol:
getPriceAndFee
function, especially if the amount parameter is excessively large.asD.sol:
asDFactory.sol:
tx.origin
in the constructor; consider using msg.sender
for better security practices.let's dive into the Codebase Quality Analysis section for each contract:
How it Works:
Market
contract facilitates the trading of shares and NFTs represented as ERC1155 tokens.Security Issues:
Recommendations:
How it Works:
getPriceAndFee
calculates the price and fee for a given number of shares using a loop.getFee
calculates fees based on a logarithmic function.Security Issues:
getPriceAndFee
due to the use of a loop.log2
might reduce code readability.Recommendations:
getPriceAndFee
.How it Works:
asD
is an ERC20 token with ownership functionality.cNote
for a 1:1 mint/burn exchange rate.Security Issues:
cNote
token contract.Recommendations:
cNote
token contract.How it Works:
asDFactory
creates and tracks asD tokens.Ownable2Step
for access control.Security Issues:
tx.origin
in the constructor.Recommendations:
tx.origin
with msg.sender
.Market.sol:
asDFactory.sol:
Market.sol:
LinearBondingCurve.sol:
asD.sol:
asDFactory.sol:
Market.sol:
LinearBondingCurve.sol:
asD.sol:
asDFactory.sol:
Conclusion:
The analyzed contracts demonstrate a solid foundation, but careful consideration is needed for potential security risks, especially in handling external token contracts and access controls. Implementing suggested recommendations and conducting a detailed security audit will contribute to a more robust and secure smart contract application.
10 hours
#0 - c4-judge
2023-11-29T20:44:03Z
MarioPoneder marked the issue as grade-b