Skip to main content

MISOTokenFactory

MISOTokenFactory is a factory contract to deploy your very own, source code verified token contracts.

The full contract can be found here.

Functions

initMISOTokenFactory

function initMISOTokenFactory(address _accessControls) external

Single gateway to initialize the MISO Token Factory with the proper address. Can only be initialized once.

Parameters

NameTypeDescription
_accessControlsaddressaccess control address

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

deployToken

function deployToken(
uint256 _templateId,
address payable _integratorFeeAccount
)
public payable returns (address token)

Creates a token corresponding to the given template ID and transfers fees.

Parameters

NameTypeDescription
_templateIduint256template ID of token to create
_integratorFeeAccountaddressaddress to pay fee to

Returns

NameTypeDescription
tokenaddressaddress of deployed token

createToken

function createToken(
uint256 _templateId,
address payable _integratorFeeAccount,
bytes calldata _data
)
external payable returns (address token)

Creates a token corresponding to the given template ID.

Parameters

NameTypeDescription
_templateIduint256template ID of token to create
_integratorFeeAccountaddressaddress to pay fee to
_databytesdata passed to token contract for init

Returns

NameTypeDescription
tokenaddressaddress of deployed token

addTokenTemplate

function addTokenTemplate(address _template) external

Adds a token template to create through factory. Must have operator access.

Parameters

NameTypeDescription
_templateaddressaddress of token template to create

removeTokenTemplate

function removeTokenTemplate(uint256 _templateId) external

Removes a token template. Must have operator access.

Parameters

NameTypeDescription
_templateIduint256token template ID to be removed

numberOfTokens

function numberOfTokens() external view returns (uint256)

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

getTokens

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

View function that returns an array of the addresses of the tokens in the factory.

getTokenTemplate

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

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

Parameters

NameTypeDescription
_templateIduint256token template ID that you want address of

getTemplateId

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

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

Parameters

NameTypeDescription
_tokenTemplateaddressaddress of token template that you want ID of