Skip to main content

MISOMarket

MISOMarket is a factory contract to help you conveniently deploy your own source code verified auctions.

The full contract can be found here.

Functions

initMISOMarket

function initMISOMarket(address _accessControls, address _bentoBox, address[] memory _templates) external

Initializes the market with a list of auction templates. Can only be initialized once.

Parameters

NameTypeDescription
accessControlsaddressaddress to get the access controls from
_bentoBoxaddressBentoBox address
_templatesaddress[]initial array of MISOMarket templates

setMinimumFee

function setMinimumFee(uint256 _amount) external

Sets the minimum fee. Must have operator access.

Parameters

NameTypeDescription
amountuint256fee amount to set

setIntegratorFeePct

function setIntegratorFeePct(uint256 _amount) external

Sets the integrator fee percentage. Must have operator access.

Parameters

NameTypeDescription
amountuint256fee percentage to set

setDividends

function setDividends(address payable _divaddr) external

Sets the dividend address. Must have operator access.

Parameters

NameTypeDescription
_divaddraddress payabledividend address to set

setLocked

function setLocked(bool _locked) external

Sets the factory to be locked or unlocked.

Parameters

NameTypeDescription
_lockedbooltrue if locked, false if unlocked

setCurrentTemplateId

function setCurrentTemplateId(uint256 _templateType, uint256 _templateId) external

Sets the current template ID for any type. Must have operator access.

Parameters

NameTypeDescription
_templateTypeuint256type of template
_templateIduint256ID of the current template for that type

hasMarketMinterRole

function hasMarketMinterRole(address _address) public view returns (bool)

Used to check whether an address has the minter role, returns a boolean.

Parameters

NameTypeDescription
_addressaddressaddress of account or contract being checked

deployMarket

function deployMarket(
uint256 _templateId,
address payable _integratorFeeAccount
)
public payable returns (address newMarket)

Creates a new MISOMarket from _templateId and transfers fees.

Parameters

NameTypeDescription
_templateIduint256template ID of the crowdsale template to create
_integratorFeeAccountaddress payableaddress to pay the fee to

Returns

NameTypeDescription
newMarketaddressnew market address

createMarket

function createMarket(
uint256 _templateId,
address _token,
uint256 _tokenSupply,
address payable _integratorFeeAccount,
bytes calldata _data
)
external payable returns (address newMarket)

Creates a new MISOMarket from _templateId.

Parameters

NameTypeDescription
_templateIduint256template ID of the auction template to create
_tokenaddressaddress of the token to be sold
_tokenSupplyuint256amount of tokens to be sold at market
_integratorFeeAccountaddress payableaddress to send referral bonus to, if set
_databytesdata passed to the template for init

Returns

NameTypeDescription
newMarketaddressnew market address

addAuctionTemplate

function addAuctionTemplate(address _template) external

Calls _addAuctionTemplate, which adds an auction template to create through factory. Must have operator access.

Parameters

NameTypeDescription
_templateaddressauction template address

_addAuctionTemplate

function _addAuctionTemplate(address _template) internal

Internal function called by addAuctionTemplate, it adds an auction template to create through factory. Must have operator access.

Parameters

NameTypeDescription
_templateaddressauction template address

removeAuctionTemplate

function removeAuctionTemplate(uint256 _templateId) external

Removes an auction template. Must have operator access.

Parameters

NameTypeDescription
_templateIduint256ID of template to be deleted

getAuctionTemplate

function getAuctionTemplate(uint256 _templateId) external view returns (address)

View function that returns a template address based on the ID.

Parameters

NameTypeDescription
_templateIduint256ID of template to get address of

getTemplateId

function getTemplateId(address _auctionTemplate) external view returns (uint256)

View function that returns a template ID based on the address.

Parameters

NameTypeDescription
_auctionTemplateaddressaddress of template to get ID of

numberOfAuctions

function numberOfAuctions() external view returns (uint)

View function that returns the total number of auctions in the factory.

minimumFee

function minimumFee() external view returns(uint128)

View function that returns the minimumFee of the auctions in the contract.

getMarkets

function getMarkets() external view returns(address[] memory)

View function that returns an array of all the addresses of all the auctions in the contract.

getMarketTemplateId

function getMarketTemplateId(address _auction) external view returns(uint64)

View function that returns the Market Template ID for a given auction address.

Parameters

NameTypeDescription
_auctionaddressaddress of auction to get ID of