Company Simulator

First Flight #51
Beginner FriendlyDeFi
100 EXP
View results
Submission Details
Impact: high
Likelihood: high
Invalid

The owner cannot redeem any of their supplied funds or profit

Description

Cyfrin_Hub is set up to allow for investors to supply funds for shares of the company. It also allows the company owner to supply funds, but they do not get shares for their investment. This means that investors can redeem portions of the company's holdings with their shares, but the owner cannot access or redeem any of the holdings.

This is specifically for when the owner funds using fund_cyfrin with 0 as the parameter which would call fund_owner.

@payable
@internal
def fund_owner():
"""
@notice Allows the owner to inject ETH into the company without receiving shares.
@dev Increases company_balance directly. No shares are issued.
Only the owner can call this function.
@dev This simulates owner capital injections or personal investment.
"""
assert msg.sender == OWNER, "Not the owner!!!"
self.company_balance += msg.value

Note that there is nothing stopping the owner from going through fund_investor, which would give the owner shares for their investment.

There is no clear way for funds, including profits, to be recovered from this contract by the owner. If the company grows large, most of the funds will be locked in the contract.

Risk

Likelihood:

The owner would have to invest into the compnay without receiving shares. Most of the problems would occur if the company grew large, leaving most funds in the contract inaccessible due to the MAX_PAYOUT_PER_SHARE.

Impact:

The owner cannot recover any of their investment into the company. They also cannot access any of the company's profits.

Recommended Mitigation

Consider tracking the contributions of the owner. They should be able to gain shares, but their shares should not have a cap.

Also consider allowing the owner to be able to increase the amount of public shares to more than TOTAL_SHARES, and allow the owner to reduce the number of shares when not all are being held. This would allow the owner to control the amount of the company they own.

Updates

Lead Judging Commences

0xshaedyw Lead Judge
7 days ago
0xshaedyw Lead Judge 6 days ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.