MidasFactory721

MidasFactory721

Contract used to deploy and register new MidasPairs. Enables setting fee parameters, protocol fees and Midas Pair implementation.

constructor

constructor(address _royaltyEngine)

Parameters

Name

Type

Description

_royaltyEngine

address

The smart contract which provides royalty data

OwnerChanged

event OwnerChanged(address indexed oldOwner, address indexed newOwner);

PairImplementationSet

event PairImplementationSet(address indexed oldPair, address indexed newPair);

LptImplementationSet

event LptImplementationSet(address indexed oldLPT, address indexed newLPT);

PairCreated

event PairCreated(address indexed tokenX, address indexed tokenY, address indexed pair, address lpToken);

feeRecipient

function feeRecipient() external view

View function to get the recipient address which receives the protocol fee.

Return Values

Name

Type

Description

_feeRecipient

address

The recipient address of protocol fee

createERC721Pair

function createERC721Pair(address _tokenX, address _tokenY) external override noDelegateCall

Function to create a new Midas Pair for _token0 and _token1.

Parameters

Name

Type

Description

_tokenX

address

The address of the first token

_tokenY

address

The address of the second token

Return Values

Name

Type

Description

lpToken

address

The address of LP token

pair

address

The address of the newly created MidasPair

setOwner

function setOwner(address _owner) external

Function to set up a new owner of the factory.

Parameters

Name

Type

Description

_owner

address

The address of the new owner

setRoyaltyInfo

function setRoyaltyInfo(address _nftAddress, address _pair) public 

Function to update royalty info for the specific MidasPair.

Parameters

Name

Type

Description

_nftAddress

address

The address of the NFT asset in the MidasPair

_pair

address

The address of the MidasPair

setRoyaltyEngine

function setRoyaltyEngine(address _newRoyaltyEngine) external 

Function to update royalty engine contract address.

Parameters

Name

Type

Description

_newRoyaltyEngine

address

The new Royalty Engine address

setRoyaltyInfo

 function setRoyaltyInfo(address _tokenX, address _tokenY, bool isZero) external

Function to set a new royalty rate for all the following MidasPair.

Parameters

Name

Type

Description

address

_tokenX

The address of the NFT

address

_tokenY

The address of the FT

isZero

bool

Initialize royalty rate for NFT

setPairImplementation

function setPairImplementation(address _newPairImplementation) external 

Function to set a new implementation of MidasPair to be cloned.

Parameters

Name

Type

Description

_newPairImplementation

address

The new template address of MidasPair

setLptImplementation

function setLptImplementation(address _newLptImplementation) external 

Function to set a new implementation of LPToken to be cloned.

Parameters

Name

Type

Description

_newLptImplementation

address

The new template address of LPToken

flashLoan

function flashLoan(address _token0, address _token1, IMidasFlashLoanCallback receiver, uint256[] calldata _tokenIds, bytes calldata data) external

Function to execute flash loans towards the specific MidasPair.

Parameters

Name

Type

Description

_tokenX

address

The address of NFT

_tokenY

address

The address of FT

receiver

IMidasFlashLoanCallback

The implementation of receiver

_tokenIds

uint256[] calldata

The list of NFT tokenIds to be borrowed

data

bytes calldata

The data to be transferred along with function revoking

Last updated