Skip to main content

SubjectFactory.sol

Functions

initiateSubjectOnboarding

Function to onboard & start auction of the initial supply of subject.

function initiateSubjectOnboarding(
address _subject,
SubjectAuctionInput memory _auctionInput
) external whenNotPaused onlyRole(ONBOARDING_ROLE) returns (uint256)

Parameters

NameTypeDescription
_subjectaddressAddress of subject.
_auctionInputstructInput params for auction creation.

Return Values

NameTypeDescription
auctionIduint256Auction Id of the initialized subject auction.

finalizeSubjectOnboarding

Finalize subject onboarding.

  1. Close auction
  2. Burn unsold supply
  3. Calculate additional mint for onboarding reserve
  4. Calculate & transfer fee.
  5. Initiate bonding curve.
function finalizeSubjectOnboarding(
address _subject,
uint256 _buyAmount,
uint32 _reserveRatio
) external whenNotPaused onlyRole(ONBOARDING_ROLE)

Parameters

NameTypeDescription
_subjectaddressAddress of subject token.
_buyAmountuint256Amount of tokens contract will be used to buy shares of the subject token.
_reserveRatiouint32Reserve ratio of bonding curve.

updateAuctionTime

Update beneficiary to `_beneficiary. It can be done by UPDATE_BENEFICIARY_ROLE.

function updateFeeBeneficiary(
address _feeBeneficiary
) external onlyRole(UPDATE_BENEFICIARY_ROLE)

Parameters

NameTypeDescription
_feeBeneficiaryaddressThe address of the new beneficiary [to whom fees are to be sent]

updateFees

Update fee only be called by role UPDATE_FEES_ROLE.

function updateFees(
FeeInput memory _feeInput
) external onlyRole(UPDATE_FEES_ROLE)

Parameters

NameTypeDescription
_feeInputstructFee input.

updateAuctionTime

Update auction parameters.

function updateAuctionTime(
uint256 _auctionDuration,
uint256 _auctionOrderCancellationDuration
) external onlyRole(UPDATE_AUCTION_ROLE)

Parameters

NameTypeDescription
_auctionDurationuint256Duration of auction in unixtimestamp.
_auctionOrderCancellationDurationuint256Duration of auction order cancellation in unixtimestamp.

Errors

SubjectFactory_InvalidBeneficiary

The contract will emit the error if the beneficiary address is not valid.

error SubjectFactory_InvalidBeneficiary();

SubjectFactory_InvalidFeePercentage

The contract will emit the error if the fee percentage is not valid.

error SubjectFactory_InvalidFeePercentage();

SubjectFactory_InvalidSubject

The contract will emit the error if the subject address is not valid.

error SubjectFactory_InvalidSubject();

SubjectFactory_InvalidTokenManager

The contract will emit the error if the token manager address is not valid.

error SubjectFactory_InvalidTokenManager();

SubjectFactory_InvalidMoxieBondingCurve

The contract will emit the error if the moxie bonding curve address is not valid.

error SubjectFactory_InvalidMoxieBondingCurve();

SubjectFactory_InvalidToken

The contract will emit the error if the token address is not valid.

error SubjectFactory_InvalidToken();

SubjectFactory_InvalidAuctionDuration

The contract will emit the error if the auction duration is not valid.

error SubjectFactory_InvalidAuctionDuration();

SubjectFactory_InvalidAuctionOrderCancellationDuration

The contract will emit the error if the auction order cancellation duration is not valid.

error SubjectFactory_InvalidAuctionOrderCancellationDuration();

SubjectFactory_InvalidAuctionContract

The contract will emit the error if the auction contract is not valid.

error SubjectFactory_InvalidAuctionContract();

SubjectFactory_AuctionAlreadyCreated

The contract will emit the error if the auction is already created.

error SubjectFactory_AuctionAlreadyCreated();

SubjectFactory_AuctionNotCreated

The contract will emit the error if the auction is not created.

error SubjectFactory_AuctionNotCreated();

SubjectFactory_AuctionNotDoneYet

The contract will emit the error if the auction is not done yet.

error SubjectFactory_AuctionNotDoneYet();

SubjectFactory_InvalidOwner

The contract will emit the error if the owner address is not valid.

error SubjectFactory_InvalidOwner();

SubjectFactory_InvalidReserveRatio

The contract will emit the error if the reserve ratio is not valid.

error SubjectFactory_InvalidReserveRatio();

SubjectFactory_BuyAmountTooLess

The contract will emit the error if the buy amount is too less.

error SubjectFactory_BuyAmountTooLess();