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
Name | Type | Description |
---|---|---|
_subject | address | Address of subject. |
_auctionInput | struct | Input params for auction creation. |
Return Values
Name | Type | Description |
---|---|---|
auctionId | uint256 | Auction Id of the initialized subject auction. |
finalizeSubjectOnboarding
Finalize subject onboarding.
- Close auction
- Burn unsold supply
- Calculate additional mint for onboarding reserve
- Calculate & transfer fee.
- Initiate bonding curve.
function finalizeSubjectOnboarding(
address _subject,
uint256 _buyAmount,
uint32 _reserveRatio
) external whenNotPaused onlyRole(ONBOARDING_ROLE)
Parameters
Name | Type | Description |
---|---|---|
_subject | address | Address of subject token. |
_buyAmount | uint256 | Amount of tokens contract will be used to buy shares of the subject token. |
_reserveRatio | uint32 | Reserve 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
Name | Type | Description |
---|---|---|
_feeBeneficiary | address | The 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
Name | Type | Description |
---|---|---|
_feeInput | struct | Fee input. |
updateAuctionTime
Update auction parameters.
function updateAuctionTime(
uint256 _auctionDuration,
uint256 _auctionOrderCancellationDuration
) external onlyRole(UPDATE_AUCTION_ROLE)
Parameters
Name | Type | Description |
---|---|---|
_auctionDuration | uint256 | Duration of auction in unixtimestamp. |
_auctionOrderCancellationDuration | uint256 | Duration 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();