DealManager

Contract behaviors:

  • storeDeal(deal)

  • existDealByUuid(uuid)

  • countDeals()

  • getDealByUuid(uuid)

  • getDealById(id)

Contract properties:

  • DealData[] public deals

  • mapping(string => uint256) public dealsByUuid

  • lastChangeAt

Contract events:

  • event DealStored(string uuid);

Roles:

  • DEFAULT_ADMIN_ROLE

  • EDITOR_ROLE

Admin-only functions:

  • storeDeal(EDITOR_ROLE)

CA

struct DealData {
    string uuid;
    uint createdAt;
    uint updatedAt;
    bool interestDiscoveryActive;
    bool fundraisingActiveForRegistered;
    bool fundraisingActiveForEveryone;
    bool refundAllowed;
    uint256 minAllocation;
    uint256 maxAllocation;
    uint256 totalAllocation;
    IERC20 collectedToken;
}

interface IDealManager {
    function storeDeal(DealData memory deal) external;
    function existDealByUuid(string memory uuid) external view returns (bool);
    function countDeals() external view returns (uint);

    function getDealByUuid(
        string memory uuid
    ) external view returns (DealData memory);

    function getDealById(
        uint256 id
    ) external view returns (DealData memory);
}

Last updated