From cff4f2a49f92ab63d088133e83c91b81de6373d1 Mon Sep 17 00:00:00 2001 From: Tempe Techie <95053628+tempe-techie@users.noreply.github.com> Date: Mon, 29 Jan 2024 20:27:07 +0100 Subject: [PATCH] SFS implemented in NFT Launchpad contracts --- .../erc721/IggyLaunchpad721Bonding.sol | 20 +++++++++++++++- contracts/launchpad/erc721/Nft721Bonding.sol | 23 ++++++++++++------- .../activity-points/activityPoints.deploy.js | 2 +- .../activityPointsAlt.deploy.js | 2 +- .../activity-points/apLeaderboardFairchat.js | 2 +- scripts/activity-points/calls.js | 2 +- scripts/custom/minterV2ambassadors.deploy.js | 2 +- scripts/distributor/distributor.deploy.js | 2 +- .../distributor/distributorFactory.deploy.js | 2 +- scripts/keys/1_friendKeys.deploy.js | 2 +- .../erc721/3_launchpadBonding.deploy.js | 10 ++++---- scripts/launchpad/erc721/4_arguments.js | 12 ++++++---- .../launchpad/erc721/4_verifyNftContract.js | 7 +++--- scripts/launchpad/erc721/5_mockNftContract.js | 17 +++++++------- ...NftMetadataOnchainMultipleImages.deploy.js | 2 +- .../erc721/other/addOldNftsToNewLaunchpad.js | 2 +- scripts/launchpad/erc721/other/calls.js | 2 +- scripts/launchpad/erc721/other/nftRaffle.js | 2 +- scripts/merkle/merkleClaimerERC721.deploy.js | 2 +- scripts/mock/mockCreateGovernanceProposal.js | 2 +- scripts/mock/mockERC721.deploy.js | 2 +- scripts/mock/mockGovernorBlock.deploy.js | 2 +- scripts/mock/mockToken.deploy.js | 2 +- scripts/mock/mockTokenVotingBlock.deploy.js | 2 +- .../early-stakers/earlyStakerNft.deploy.js | 2 +- .../nft/early-stakers/onlyMetadata.deploy.js | 2 +- scripts/other/manager/addManager.js | 2 +- scripts/post/IggyPostNft1155/calls.js | 2 +- .../post/IggyPostNft1155/minterV2.deploy.js | 2 +- .../staking/addStakingAddressToPostMinter.js | 2 +- scripts/staking/iggyStakingRewards.deploy.js | 2 +- scripts/stats/calls.js | 2 +- scripts/swap/IggySwapRouter.deploy.js | 2 +- scripts/swap/IggySwapRouterSolidly.deploy.js | 2 +- scripts/token/ChatToken/chatToken.deploy.js | 2 +- .../chatTokenClaimActivityPoints.deploy.js | 2 +- .../chatTokenClaimDomains.deploy.js | 6 ++--- .../ChatTokenMinter/chatTokenMinter.deploy.js | 2 +- test/launchpad/bonding721.test.js | 14 +++++++++++ 39 files changed, 105 insertions(+), 66 deletions(-) diff --git a/contracts/launchpad/erc721/IggyLaunchpad721Bonding.sol b/contracts/launchpad/erc721/IggyLaunchpad721Bonding.sol index 945ad75..9b2033b 100644 --- a/contracts/launchpad/erc721/IggyLaunchpad721Bonding.sol +++ b/contracts/launchpad/erc721/IggyLaunchpad721Bonding.sol @@ -24,6 +24,10 @@ interface INftMetadata { function setName(address nftAddress_, string memory name_) external; } +interface ISFSF { + function assign(uint256 _tokenId) external returns (uint256); +} + interface IStatsContract { function addWeiSpent(address user_, uint256 weiSpent_) external; function addWriterByWriter(address writer_) external; @@ -37,6 +41,7 @@ contract IggyLaunchpad721Bonding is OwnableWithManagers, ReentrancyGuard { address public metadataAddress; address public mintingFeeReceiver; // the address that receives the ETH paid for launching a new NFT contract & minting fees from NFT contracts address public nftDirectoryAddress; + address public sfsAddress; address public statsAddress; // usually the stats middleware address bool public paused = false; // pause launching collections through the factory contract @@ -55,9 +60,14 @@ contract IggyLaunchpad721Bonding is OwnableWithManagers, ReentrancyGuard { address _mintingFeeReceiver, address _nftDirectoryAddress, address _statsAddress, + address _sfsAddress, + uint256 _sfsNftId, uint256 _mintingFeePercentage, uint256 _price ) { + ISFSF(_sfsAddress).assign(_sfsNftId); + sfsAddress = _sfsAddress; + metadataAddress = _metadataAddress; mintingFeeReceiver = _mintingFeeReceiver; nftDirectoryAddress = _nftDirectoryAddress; @@ -145,7 +155,10 @@ contract IggyLaunchpad721Bonding is OwnableWithManagers, ReentrancyGuard { // create new NFT contract bytes32 saltedHash = keccak256(abi.encodePacked(msg.sender, block.timestamp, uniqueId_)); Nft721Bonding nftContract = new Nft721Bonding{salt: saltedHash}( - address(this), metadataAddress, mintingFeeReceiver, name_, symbol_, mintingFeePercentage, ratio + contractOwner_, + name_, + symbol_, + ratio ); // update nftAddressById mapping and allNftContracts array @@ -211,6 +224,11 @@ contract IggyLaunchpad721Bonding is OwnableWithManagers, ReentrancyGuard { referralFeePercentage = _referralFeePercentage; } + /// @notice Set SFS address (only owner) + function setSfsAddress(address _sfsAddress) external onlyOwner { + sfsAddress = _sfsAddress; + } + /// @notice Set stats contract address function setStatsAddress(address _statsAddress) external onlyManagerOrOwner { statsAddress = _statsAddress; diff --git a/contracts/launchpad/erc721/Nft721Bonding.sol b/contracts/launchpad/erc721/Nft721Bonding.sol index 5be3a21..7d103dc 100644 --- a/contracts/launchpad/erc721/Nft721Bonding.sol +++ b/contracts/launchpad/erc721/Nft721Bonding.sol @@ -6,7 +6,11 @@ import { OwnableWithManagers } from "../../access/OwnableWithManagers.sol"; import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; interface IFactory { + function metadataAddress() external view returns (address); + function mintingFeePercentage() external view returns (uint256); + function mintingFeeReceiver() external view returns (address); function owner() external view returns (address); + function sfsAddress() external view returns (address); function statsAddress() external view returns (address); } @@ -15,6 +19,10 @@ interface INftMd { function getMetadata(address nftAddress_, uint256 tokenId_) external view returns (string memory); } +interface ISFS { + function register(address _recipient) external returns (uint256 tokenId); +} + interface IStats { function addWeiSpent(address user_, uint256 weiSpent_) external; } @@ -37,19 +45,18 @@ contract Nft721Bonding is ERC721, ERC721Enumerable, OwnableWithManagers, Reentra // CONSTRUCTOR constructor( - address factoryAddress_, - address metadataAddress_, - address mintingFeeReceiver_, + address sfsNftOwner, string memory name_, string memory symbol_, - uint256 mintingFeePercentage_, uint256 ratio_ ) ERC721(name_, symbol_) { - factoryAddress = factoryAddress_; - metadataAddress = metadataAddress_; - mintingFeeReceiver = mintingFeeReceiver_; + ISFS(IFactory(msg.sender).sfsAddress()).register(sfsNftOwner); // register the contract creator in the SFS contract + + factoryAddress = msg.sender; + metadataAddress = IFactory(msg.sender).metadataAddress(); + mintingFeeReceiver = IFactory(msg.sender).mintingFeeReceiver(); - mintingFeePercentage = mintingFeePercentage_; + mintingFeePercentage = IFactory(msg.sender).mintingFeePercentage(); ratio = ratio_; createdAt = block.timestamp; } diff --git a/scripts/activity-points/activityPoints.deploy.js b/scripts/activity-points/activityPoints.deploy.js index 1702bb7..2463afc 100644 --- a/scripts/activity-points/activityPoints.deploy.js +++ b/scripts/activity-points/activityPoints.deploy.js @@ -4,7 +4,7 @@ const contractName = "ActivityPoints"; const statsAddress = ""; // stats contract const mintedPostsStatsAddress = ""; -const tldStatsAddress = ethers.constants.AddressZero; +const tldStatsAddress = ""; const multiplier = 100000; // 1 wei = 100000 points const sfsAddress = (network.name == "modeTestnet") ? "0xBBd707815a7F7eb6897C7686274AFabd7B579Ff6" : "0x8680CEaBcb9b56913c519c069Add6Bc3494B7020"; diff --git a/scripts/activity-points/activityPointsAlt.deploy.js b/scripts/activity-points/activityPointsAlt.deploy.js index 8d3be9b..21a3abb 100644 --- a/scripts/activity-points/activityPointsAlt.deploy.js +++ b/scripts/activity-points/activityPointsAlt.deploy.js @@ -4,7 +4,7 @@ const contractName = "ActivityPointsAlt"; const statsAddress = ""; // stats contract const mintedPostsStatsAddress = ""; -const tldStatsAddress = ethers.constants.AddressZero; +const tldStatsAddress = ""; const multiplier = 100000; // 1 wei = 100000 points const sfsAddress = (network.name == "modeTestnet") ? "0xBBd707815a7F7eb6897C7686274AFabd7B579Ff6" : "0x8680CEaBcb9b56913c519c069Add6Bc3494B7020"; const sfsNftTokenId = 0; // TODO: Enter SFS NFT token ID!!! diff --git a/scripts/activity-points/apLeaderboardFairchat.js b/scripts/activity-points/apLeaderboardFairchat.js index cf55161..adc1506 100644 --- a/scripts/activity-points/apLeaderboardFairchat.js +++ b/scripts/activity-points/apLeaderboardFairchat.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/activity-points/apLeaderboardFairchat.js --network zkfair +// npx hardhat run scripts/activity-points/apLeaderboardFairchat.js --network modeTestnet const contractName = "ActivityPoints"; diff --git a/scripts/activity-points/calls.js b/scripts/activity-points/calls.js index 48635b7..9330262 100644 --- a/scripts/activity-points/calls.js +++ b/scripts/activity-points/calls.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/activity-points/calls.js --network zkfair +// npx hardhat run scripts/activity-points/calls.js --network modeTestnet const contractName = "ActivityPoints"; diff --git a/scripts/custom/minterV2ambassadors.deploy.js b/scripts/custom/minterV2ambassadors.deploy.js index 052de5d..185f87b 100644 --- a/scripts/custom/minterV2ambassadors.deploy.js +++ b/scripts/custom/minterV2ambassadors.deploy.js @@ -1,5 +1,5 @@ // Deploy minter V2 contract -// npx hardhat run scripts/custom/minterV2ambassadors.deploy.js --network songbird +// npx hardhat run scripts/custom/minterV2ambassadors.deploy.js --network modeTestnet // It will automatically set different fees (if needed) and set the staking contract address (if needed). // It will also automatically add the minter to the ChatTokenMinter contract and change the minter address in the post contract. // If any of these actions fail, you must do them manually. diff --git a/scripts/distributor/distributor.deploy.js b/scripts/distributor/distributor.deploy.js index 2480f53..29cfa0a 100644 --- a/scripts/distributor/distributor.deploy.js +++ b/scripts/distributor/distributor.deploy.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/distributor/distributor.deploy.js --network bsc +// npx hardhat run scripts/distributor/distributor.deploy.js --network modeTestnet const contractName = "RevenueDistributor"; diff --git a/scripts/distributor/distributorFactory.deploy.js b/scripts/distributor/distributorFactory.deploy.js index 1f05de9..fc3dede 100644 --- a/scripts/distributor/distributorFactory.deploy.js +++ b/scripts/distributor/distributorFactory.deploy.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/distributor/distributorFactory.deploy.js --network bsc +// npx hardhat run scripts/distributor/distributorFactory.deploy.js --network modeTestnet const contractName = "RevenueDistributorFactory"; diff --git a/scripts/keys/1_friendKeys.deploy.js b/scripts/keys/1_friendKeys.deploy.js index 5428b00..de30b12 100644 --- a/scripts/keys/1_friendKeys.deploy.js +++ b/scripts/keys/1_friendKeys.deploy.js @@ -1,5 +1,5 @@ // 1. Deploy FriendKeys contract and automatically add it's address to the Stats middleware contract. -// npx hardhat run scripts/keys/1_friendKeys.deploy.js --network zkfair +// npx hardhat run scripts/keys/1_friendKeys.deploy.js --network modeTestnet const contractName = "FriendKeys"; diff --git a/scripts/launchpad/erc721/3_launchpadBonding.deploy.js b/scripts/launchpad/erc721/3_launchpadBonding.deploy.js index 8490e1e..a2aaf3a 100644 --- a/scripts/launchpad/erc721/3_launchpadBonding.deploy.js +++ b/scripts/launchpad/erc721/3_launchpadBonding.deploy.js @@ -3,12 +3,12 @@ const contractName = "IggyLaunchpad721Bonding"; -const metadataAddress = "0xc486B08Ed47fFe5c1b4b1A2ff5c671EA0083D9bA"; -const mintingFeeReceiver = "0x6771F33Cfd8C6FC0A1766331f715f5d2E1d4E0e2"; // revenue distributor contract address -const directoryAddress = "0x6AbDd1Bf5078cC6b0D75caFCdDC69A8339067F50"; -const statsMiddlewareAddress = "0xce314209aB485bE222CE85F653Ac918f54532503"; -const mintingFeePercentage = ethers.utils.parseEther("0.02"); const price = ethers.utils.parseEther("0.0001"); // price for creating a new NFT collection +const metadataAddress = ""; +const mintingFeeReceiver = ""; // revenue distributor contract address +const directoryAddress = ""; +const statsMiddlewareAddress = ""; +const mintingFeePercentage = ethers.utils.parseEther("0.02"); async function main() { const [deployer] = await ethers.getSigners(); diff --git a/scripts/launchpad/erc721/4_arguments.js b/scripts/launchpad/erc721/4_arguments.js index 9f453c0..bbc621f 100644 --- a/scripts/launchpad/erc721/4_arguments.js +++ b/scripts/launchpad/erc721/4_arguments.js @@ -1,9 +1,11 @@ module.exports = [ - "0x498e0e6B245898c5E2dD0299d0456a8928F58ECC", // factory address - "0x4A82158ff4B0504F3DB4c7555FfB6298452985E2", // metadata address - "0x6771F33Cfd8C6FC0A1766331f715f5d2E1d4E0e2", // minting fee receiver address - "Always Liquid on Polygon", // collection name - "ALPOLY", // collection symbol + "", // factory address + "", // metadata address + "", // minting fee receiver address + "", // SFS contract address + "", // contract owner address + "Hello World", // collection name + "HELLO", // collection symbol "20000000000000000", // minting fee percentage "100000000000000000" // ratio ]; \ No newline at end of file diff --git a/scripts/launchpad/erc721/4_verifyNftContract.js b/scripts/launchpad/erc721/4_verifyNftContract.js index 4318959..ef9c2ed 100644 --- a/scripts/launchpad/erc721/4_verifyNftContract.js +++ b/scripts/launchpad/erc721/4_verifyNftContract.js @@ -1,15 +1,14 @@ // TODO: // 1. Create the first NFT collection through the factory. // 2. Verify the contract on block explorer using this script (run the command below). -// Run: npx hardhat run scripts/launchpad/erc721/4_verifyNftContract.js --network polygon +// Run: npx hardhat run scripts/launchpad/erc721/4_verifyNftContract.js --network modeTestnet -const networkName = "polygon"; -const contractAddress = "0x73Bf93b294AF8514a7E2dEf4E37877AeaE854a90"; +const contractAddress = ""; async function main() { console.log("Copy the line below and paste it in your terminal to verify the TLD contract on Etherscan:"); console.log(""); - console.log("npx hardhat verify --network " + networkName + " --constructor-args scripts/launchpad/erc721/4_arguments.js " + contractAddress); + console.log("npx hardhat verify --network " + network.name + " --constructor-args scripts/launchpad/erc721/4_arguments.js " + contractAddress); } main() diff --git a/scripts/launchpad/erc721/5_mockNftContract.js b/scripts/launchpad/erc721/5_mockNftContract.js index 7cb437a..5c788d3 100644 --- a/scripts/launchpad/erc721/5_mockNftContract.js +++ b/scripts/launchpad/erc721/5_mockNftContract.js @@ -4,13 +4,15 @@ const contractName = "Nft721Bonding"; -const factoryAddress = "0x3Fa0EaC3058828Cc4BA97F51A33597C695bF6F9e"; -const metadataAddress = "0xc486B08Ed47fFe5c1b4b1A2ff5c671EA0083D9bA"; -const mintingFeeReceiver = "0xb29050965a5ac70ab487aa47546cdcbc97dae45d"; +const factoryAddress = ""; +const metadataAddress = ""; +const mintingFeeReceiver = ""; const cName = "Test collection"; const cSymbol = "TEST"; const mintingFeePercentage = ethers.utils.parseEther("0.02"); -const ratio = ethers.utils.parseEther("4200"); +const ratio = ethers.utils.parseEther("1"); + +const sfsAddress = (network.name == "modeTestnet") ? "0xBBd707815a7F7eb6897C7686274AFabd7B579Ff6" : "0x8680CEaBcb9b56913c519c069Add6Bc3494B7020"; async function main() { const [deployer] = await ethers.getSigners(); @@ -21,12 +23,9 @@ async function main() { // deploy contract const contract = await ethers.getContractFactory(contractName); const instance = await contract.deploy( - factoryAddress, - metadataAddress, - mintingFeeReceiver, + deployer.address, cName, cSymbol, - mintingFeePercentage, ratio ); await instance.deployed(); @@ -34,7 +33,7 @@ async function main() { console.log(contractName + " contract address:", instance.address); console.log("Wait a minute and then run this command to verify contracts on block explorer:"); - console.log("npx hardhat verify --network " + network.name + " " + instance.address + " " + factoryAddress + " " + metadataAddress + " " + mintingFeeReceiver + ' "' + cName + '" "' + cSymbol + '" "' + mintingFeePercentage + '" "' + ratio + '"'); + console.log("npx hardhat verify --network " + network.name + " " + instance.address + " " + " " + deployer.address + ' "' + cName + '" "' + cSymbol + '" "' + ratio + '"'); } main() diff --git a/scripts/launchpad/erc721/other/NftMetadataOnchainMultipleImages.deploy.js b/scripts/launchpad/erc721/other/NftMetadataOnchainMultipleImages.deploy.js index 43deefa..3f172af 100644 --- a/scripts/launchpad/erc721/other/NftMetadataOnchainMultipleImages.deploy.js +++ b/scripts/launchpad/erc721/other/NftMetadataOnchainMultipleImages.deploy.js @@ -1,5 +1,5 @@ // Deploy NftMetadata contract for multiple onchain images -// npx hardhat run scripts/launchpad/erc721/other/NftMetadataOnchainMultipleImages.deploy.js --network flare +// npx hardhat run scripts/launchpad/erc721/other/NftMetadataOnchainMultipleImages.deploy.js --network modeTestnet const contractName = "NftMetadataOnchainMultipleImages"; diff --git a/scripts/launchpad/erc721/other/addOldNftsToNewLaunchpad.js b/scripts/launchpad/erc721/other/addOldNftsToNewLaunchpad.js index 00dcff4..659eac1 100644 --- a/scripts/launchpad/erc721/other/addOldNftsToNewLaunchpad.js +++ b/scripts/launchpad/erc721/other/addOldNftsToNewLaunchpad.js @@ -1,5 +1,5 @@ // Add NFTs from the old launchpad to the new one -// npx hardhat run scripts/launchpad/erc721/other/addOldNftsToNewLaunchpad.js --network flare +// npx hardhat run scripts/launchpad/erc721/other/addOldNftsToNewLaunchpad.js --network modeTestnet const launchpadContractName = "IggyLaunchpad721Bonding"; const newLaunchpadAddress = ""; diff --git a/scripts/launchpad/erc721/other/calls.js b/scripts/launchpad/erc721/other/calls.js index 9cbaf7c..9bf2ff8 100644 --- a/scripts/launchpad/erc721/other/calls.js +++ b/scripts/launchpad/erc721/other/calls.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/launchpad/erc721/other/calls.js --network zkfair +// npx hardhat run scripts/launchpad/erc721/other/calls.js --network modeTestnet const contractName = "IggyLaunchpad721Bonding"; diff --git a/scripts/launchpad/erc721/other/nftRaffle.js b/scripts/launchpad/erc721/other/nftRaffle.js index a090fdd..3545bae 100644 --- a/scripts/launchpad/erc721/other/nftRaffle.js +++ b/scripts/launchpad/erc721/other/nftRaffle.js @@ -1,5 +1,5 @@ // script to select 10 random winners from a list of NFT holders and creators -// npx hardhat run scripts/launchpad/erc721/other/nftRaffle.js --network scroll +// npx hardhat run scripts/launchpad/erc721/other/nftRaffle.js --network modeTestnet const { ethers } = require("hardhat"); diff --git a/scripts/merkle/merkleClaimerERC721.deploy.js b/scripts/merkle/merkleClaimerERC721.deploy.js index 9f614ab..f9fd57d 100644 --- a/scripts/merkle/merkleClaimerERC721.deploy.js +++ b/scripts/merkle/merkleClaimerERC721.deploy.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/merkle/merkleClaimerERC721.deploy.js --network polygonMumbai +// npx hardhat run scripts/merkle/merkleClaimerERC721.deploy.js --network modeTestnet const data = require("./claimers.json"); const { StandardMerkleTree } = require("@openzeppelin/merkle-tree"); diff --git a/scripts/mock/mockCreateGovernanceProposal.js b/scripts/mock/mockCreateGovernanceProposal.js index 134a959..8663190 100644 --- a/scripts/mock/mockCreateGovernanceProposal.js +++ b/scripts/mock/mockCreateGovernanceProposal.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/mock/mockCreateGovernanceProposal.js --network flareCoston +// npx hardhat run scripts/mock/mockCreateGovernanceProposal.js --network modeTestnet const tokenAddress = "0x633Ae857445cF0cd02B21C6a3033C7CE74fB32c2"; // governance token contract address const governorAddress = "0x06A7Ab7Bb68b0ad6eB7688C5781E60BE6AFc658d"; // governor contract address diff --git a/scripts/mock/mockERC721.deploy.js b/scripts/mock/mockERC721.deploy.js index 83e7534..7f84a1a 100644 --- a/scripts/mock/mockERC721.deploy.js +++ b/scripts/mock/mockERC721.deploy.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/mock/mockERC721.deploy.js --network polygonMumbai +// npx hardhat run scripts/mock/mockERC721.deploy.js --network modeTestnet const contractName = "MockErc721WithMinter"; diff --git a/scripts/mock/mockGovernorBlock.deploy.js b/scripts/mock/mockGovernorBlock.deploy.js index e10ab5f..fea75b2 100644 --- a/scripts/mock/mockGovernorBlock.deploy.js +++ b/scripts/mock/mockGovernorBlock.deploy.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/mock/mockGovernorBlock.deploy.js --network flareCoston +// npx hardhat run scripts/mock/mockGovernorBlock.deploy.js --network modeTestnet const contractName = "MockGovernorBlock"; diff --git a/scripts/mock/mockToken.deploy.js b/scripts/mock/mockToken.deploy.js index c479f0a..656f326 100644 --- a/scripts/mock/mockToken.deploy.js +++ b/scripts/mock/mockToken.deploy.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/mock/mockToken.deploy.js --network polygonMumbai +// npx hardhat run scripts/mock/mockToken.deploy.js --network modeTestnet const contractName = "MockErc20TokenDecimals"; diff --git a/scripts/mock/mockTokenVotingBlock.deploy.js b/scripts/mock/mockTokenVotingBlock.deploy.js index c54e726..d4b0263 100644 --- a/scripts/mock/mockTokenVotingBlock.deploy.js +++ b/scripts/mock/mockTokenVotingBlock.deploy.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/mock/mockTokenVotingBlock.deploy.js --network flareCoston +// npx hardhat run scripts/mock/mockTokenVotingBlock.deploy.js --network modeTestnet const contractName = "MockErc20TokenVotingBlock"; diff --git a/scripts/nft/early-stakers/earlyStakerNft.deploy.js b/scripts/nft/early-stakers/earlyStakerNft.deploy.js index 7678717..c6e7004 100644 --- a/scripts/nft/early-stakers/earlyStakerNft.deploy.js +++ b/scripts/nft/early-stakers/earlyStakerNft.deploy.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/nft/early-stakers/earlyStakerNft.deploy.js --network songbird +// npx hardhat run scripts/nft/early-stakers/earlyStakerNft.deploy.js --network modeTestnet const data = require("./claimers.json"); const { StandardMerkleTree } = require("@openzeppelin/merkle-tree"); diff --git a/scripts/nft/early-stakers/onlyMetadata.deploy.js b/scripts/nft/early-stakers/onlyMetadata.deploy.js index c18afd8..2764ddc 100644 --- a/scripts/nft/early-stakers/onlyMetadata.deploy.js +++ b/scripts/nft/early-stakers/onlyMetadata.deploy.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/nft/early-stakers/onlyMetadata.deploy.js --network polygonMumbai +// npx hardhat run scripts/nft/early-stakers/onlyMetadata.deploy.js --network modeTestnet const contractName = "EarlyStakerMetadata"; diff --git a/scripts/other/manager/addManager.js b/scripts/other/manager/addManager.js index d765b6c..9da15de 100644 --- a/scripts/other/manager/addManager.js +++ b/scripts/other/manager/addManager.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/other/manager/addManager.js --network base +// npx hardhat run scripts/other/manager/addManager.js --network modeTestnet const managerAddress = ""; diff --git a/scripts/post/IggyPostNft1155/calls.js b/scripts/post/IggyPostNft1155/calls.js index 7ab9a01..17767f3 100644 --- a/scripts/post/IggyPostNft1155/calls.js +++ b/scripts/post/IggyPostNft1155/calls.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/post/IggyPostNft1155/calls.js --network songbird +// npx hardhat run scripts/post/IggyPostNft1155/calls.js --network modeTestnet const postAddress = "0xE33F27496A9cE75313f6d1FA2BA95657Fc904387"; const minterAddress = "0x9e9905FA405A5FC7Ee2DEB94CbAc089B4FE6f0Ef"; diff --git a/scripts/post/IggyPostNft1155/minterV2.deploy.js b/scripts/post/IggyPostNft1155/minterV2.deploy.js index d8efdc3..a88345b 100644 --- a/scripts/post/IggyPostNft1155/minterV2.deploy.js +++ b/scripts/post/IggyPostNft1155/minterV2.deploy.js @@ -1,5 +1,5 @@ // Deploy minter V2 contract -// npx hardhat run scripts/post/IggyPostNft1155/minterV2.deploy.js --network polygonMumbai +// npx hardhat run scripts/post/IggyPostNft1155/minterV2.deploy.js --network modeTestnet // It will automatically set different fees (if needed). // It will also automatically add the minter to the ChatTokenMinter contract and change the minter address in the post contract. // If any of these actions fail, you must do them manually. diff --git a/scripts/staking/addStakingAddressToPostMinter.js b/scripts/staking/addStakingAddressToPostMinter.js index 279f937..6709750 100644 --- a/scripts/staking/addStakingAddressToPostMinter.js +++ b/scripts/staking/addStakingAddressToPostMinter.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/staking/addStakingAddressToPostMinter.js --network songbird +// npx hardhat run scripts/staking/addStakingAddressToPostMinter.js --network modeTestnet const stakingContractAddress = "0xCA9749778327CD67700d3a777731a712330beB9A"; // staking contract address const postMinterAddress = "0xeC5Af9F794B9f26bB62Cd951088445c95EAF428D"; // post minter contract address diff --git a/scripts/staking/iggyStakingRewards.deploy.js b/scripts/staking/iggyStakingRewards.deploy.js index ab4679b..acd9b11 100644 --- a/scripts/staking/iggyStakingRewards.deploy.js +++ b/scripts/staking/iggyStakingRewards.deploy.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/staking/iggyStakingRewards.deploy.js --network polygonMumbai +// npx hardhat run scripts/staking/iggyStakingRewards.deploy.js --network modeTestnet const contractName = "IggyStakingRewards"; const assetAddress = "0xF874f79eBfB8FEe898a289C4cAa5dc4383873431"; // token to stake diff --git a/scripts/stats/calls.js b/scripts/stats/calls.js index 19b1032..75762f9 100644 --- a/scripts/stats/calls.js +++ b/scripts/stats/calls.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/stats/calls.js --network zkfair +// npx hardhat run scripts/stats/calls.js --network modeTestnet const statsMiddlewareAddress = "0x3Fa0EaC3058828Cc4BA97F51A33597C695bF6F9e"; diff --git a/scripts/swap/IggySwapRouter.deploy.js b/scripts/swap/IggySwapRouter.deploy.js index 0fba99e..fae2fa1 100644 --- a/scripts/swap/IggySwapRouter.deploy.js +++ b/scripts/swap/IggySwapRouter.deploy.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/swap/IggySwapRouter.deploy.js --network taikoJolnir +// npx hardhat run scripts/swap/IggySwapRouter.deploy.js --network modeTestnet const contractName = "IggySwapRouter"; diff --git a/scripts/swap/IggySwapRouterSolidly.deploy.js b/scripts/swap/IggySwapRouterSolidly.deploy.js index 754f4d1..ec2bbb6 100644 --- a/scripts/swap/IggySwapRouterSolidly.deploy.js +++ b/scripts/swap/IggySwapRouterSolidly.deploy.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/swap/IggySwapRouterSolidly.deploy.js --network base +// npx hardhat run scripts/swap/IggySwapRouterSolidly.deploy.js --network modeTestnet const contractName = "IggySwapRouterSolidly"; diff --git a/scripts/token/ChatToken/chatToken.deploy.js b/scripts/token/ChatToken/chatToken.deploy.js index 20a2621..6913ca3 100644 --- a/scripts/token/ChatToken/chatToken.deploy.js +++ b/scripts/token/ChatToken/chatToken.deploy.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/token/ChatToken/chatToken.deploy.js --network songbird +// npx hardhat run scripts/token/ChatToken/chatToken.deploy.js --network modeTestnet const contractName = "ChatToken"; diff --git a/scripts/token/ChatTokenClaimActivityPoints/chatTokenClaimActivityPoints.deploy.js b/scripts/token/ChatTokenClaimActivityPoints/chatTokenClaimActivityPoints.deploy.js index 87ca82c..e82b075 100644 --- a/scripts/token/ChatTokenClaimActivityPoints/chatTokenClaimActivityPoints.deploy.js +++ b/scripts/token/ChatTokenClaimActivityPoints/chatTokenClaimActivityPoints.deploy.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/token/ChatTokenClaimActivityPoints/chatTokenClaimActivityPoints.deploy.js --network polygonMumbai +// npx hardhat run scripts/token/ChatTokenClaimActivityPoints/chatTokenClaimActivityPoints.deploy.js --network modeTestnet // This script deploys the ChatTokenClaimActivityPoints contract and sets it as a minter in the ChatTokenMinter contract. // If setting the minter address fails, do it manually by calling the addMinter function in the ChatTokenMinter contract. diff --git a/scripts/token/ChatTokenClaimDomains/chatTokenClaimDomains.deploy.js b/scripts/token/ChatTokenClaimDomains/chatTokenClaimDomains.deploy.js index 3098368..96e0663 100644 --- a/scripts/token/ChatTokenClaimDomains/chatTokenClaimDomains.deploy.js +++ b/scripts/token/ChatTokenClaimDomains/chatTokenClaimDomains.deploy.js @@ -1,11 +1,11 @@ -// npx hardhat run scripts/token/ChatTokenClaimDomains/chatTokenClaimDomains.deploy.js --network songbird +// npx hardhat run scripts/token/ChatTokenClaimDomains/chatTokenClaimDomains.deploy.js --network modeTestnet // This script deploys the ChatTokenClaimDomains contract and sets it as a minter in the ChatTokenMinter contract. // If setting the minter address fails, do it manually by calling the addMinter function in the ChatTokenMinter contract. const contractName = "ChatTokenClaimDomains"; -const chatTokenMinterAddress = "0x31CfDF366dd9753b8443B6fc3c59598415697131"; // TODO: Update this address -const tldAddress = "0xBDACF94dDCAB51c39c2dD50BffEe60Bb8021949a"; // TODO: Update this address +const chatTokenMinterAddress = ""; // TODO: Update this address +const tldAddress = ""; // TODO: Update this address const chatReward = ethers.utils.parseEther("1337"); // TODO: 1 domain = 1337 CHAT tokens const maxIdEligible = 1520; // TODO: The first X number of domains (by ID) are eligible for claiming diff --git a/scripts/token/ChatTokenMinter/chatTokenMinter.deploy.js b/scripts/token/ChatTokenMinter/chatTokenMinter.deploy.js index e1249a8..46319c9 100644 --- a/scripts/token/ChatTokenMinter/chatTokenMinter.deploy.js +++ b/scripts/token/ChatTokenMinter/chatTokenMinter.deploy.js @@ -1,4 +1,4 @@ -// npx hardhat run scripts/token/ChatTokenMinter/chatTokenMinter.deploy.js --network songbird +// npx hardhat run scripts/token/ChatTokenMinter/chatTokenMinter.deploy.js --network modeTestnet // This script deploys the ChatTokenMinter contract and sets it as the minter in the ChatToken contract. // If setting the minter address fails, do it manually by calling the setMinter function in the ChatToken contract. diff --git a/test/launchpad/bonding721.test.js b/test/launchpad/bonding721.test.js index 11172b1..6c7cff7 100644 --- a/test/launchpad/bonding721.test.js +++ b/test/launchpad/bonding721.test.js @@ -80,6 +80,8 @@ describe("IggyLaunchpad721Bonding", function () { feeReceiver.address, directoryContract.address, statsMiddlewareContract.address, + sfsContract.address, + sfsNftTokenId, feePercent, priceLaunch ); @@ -133,6 +135,18 @@ describe("IggyLaunchpad721Bonding", function () { const Nft721Bonding = await ethers.getContractFactory("Nft721Bonding"); const nftContract = await Nft721Bonding.attach(nftContractAddress); + // get metadata contract address from NFT contract + const metadataContractAddress = await nftContract.metadataAddress(); + expect(metadataContractAddress).to.equal(metadataContract.address); + + // get factory contract address from NFT contract + const factoryContractAddress = await nftContract.factoryAddress(); + expect(factoryContractAddress).to.equal(launchpadContract.address); + + // get mintingFeeReceiver from NFT contract + const mintingFeeReceiver = await nftContract.mintingFeeReceiver(); + expect(mintingFeeReceiver).to.equal(feeReceiver.address); + console.log("-- Mint NFTs #1 & #2 --"); // get NFT total supply