From c18ab985c0433692d351e85836436fbba789d51e Mon Sep 17 00:00:00 2001 From: owen05 Date: Thu, 16 Sep 2021 16:14:16 +0800 Subject: [PATCH] createLiteNftPool func --- .../SmartRoute/proxies/DODONFTPoolProxy.sol | 27 ++++++++++++++++++- migrations/7_deploy_nftPool.js | 0 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 migrations/7_deploy_nftPool.js diff --git a/contracts/SmartRoute/proxies/DODONFTPoolProxy.sol b/contracts/SmartRoute/proxies/DODONFTPoolProxy.sol index ba17095..bcee646 100644 --- a/contracts/SmartRoute/proxies/DODONFTPoolProxy.sol +++ b/contracts/SmartRoute/proxies/DODONFTPoolProxy.sol @@ -40,6 +40,7 @@ contract DODONFTPoolProxy is ReentrancyGuard, InitializableOwnable { event Erc721RandomOut(address filter, address to, uint256 paid); event Erc1155RandomOut(address filter, address to, uint256 paid); + event CreateLiteNFTPool(address newFilterAdmin); event CreateNFTPool(address newFilterAdmin, address filter); event CreateFilterV1(address newFilterV1, uint256 filterTemplateKey); event Erc721toErc20(address nftContract, uint256 tokenId, address toToken, uint256 returnAmount); @@ -152,7 +153,31 @@ contract DODONFTPoolProxy is ReentrancyGuard, InitializableOwnable { // ================== Create NFTPool =================== + function createLiteNFTPool( + address filterAdminOwner, + string[] memory infos, // 0 => fragName, 1 => fragSymbol + uint256[] memory numParams //0 - initSupply, 1 - fee + ) external returns(address newFilterAdmin) { + address[] memory filters = new address[](0); + + IFilterAdmin(newFilterAdmin).init( + filterAdminOwner, + numParams[0], + infos[0], + infos[1], + numParams[1], + _CONTROLLER_, + _MAINTAINER_, + filters + ); + + emit CreateLiteNFTPool(newFilterAdmin); + } + + + function createNewNFTPoolV1( + address filterAdminOwner, address nftCollection, uint256 filterKey, //1 => FilterERC721V1, 2 => FilterERC1155V1 string[] memory infos, // 0 => filterName, 1 => fragName, 2 => fragSymbol @@ -179,7 +204,7 @@ contract DODONFTPoolProxy is ReentrancyGuard, InitializableOwnable { filters[0] = filterV1; IFilterAdmin(newFilterAdmin).init( - msg.sender, + filterAdminOwner, numParams[0], infos[1], infos[2], diff --git a/migrations/7_deploy_nftPool.js b/migrations/7_deploy_nftPool.js new file mode 100644 index 0000000..e69de29