diff --git a/package.json b/package.json index 4a535e9..e73aa2c 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "launchBNBTest" : "hardhat run scripts/launch/launch.js --network bnbTest", "launchFilCalibration" : "hardhat run scripts/launch/launch.js --network filecoinCalibaration", "launchLineaGoerli" : "hardhat run scripts/launch/launch.js --network lineaGoerli", - "contractAddress" : "hardhat run scripts/contractAddress.js" + "contractAddress" : "hardhat run scripts/contractAddress.js", + "grantRole" : "hardhat run scripts/grantRole.js --network maticmum" }, "devDependencies": { diff --git a/scripts/deploy_fusionSeries.ts b/scripts/deploy_fusionSeries.ts deleted file mode 100644 index c1ae772..0000000 --- a/scripts/deploy_fusionSeries.ts +++ /dev/null @@ -1,65 +0,0 @@ -import hre, { ethers , run } from "hardhat" -import yaml from "js-yaml" -import fs from "fs" -async function main() { - - // we have to take the input through an API - const tradehubAddr = "0x0" - const AccessMasterAddr ="0x0" - // FLOW COLLECTION CONTRACT - const FusionSeries = await hre.ethers.getContractFactory("FusionSeries"); - const fusionSeries = await FusionSeries.deploy("www.xyz.com", tradehubAddr, AccessMasterAddr); - await fusionSeries.deployed(); - console.log("FusionSeries Deployed to:", fusionSeries.address); - - if (process.env.script == "true") { - //Print for processing in deployment script - //FusionSeries address - console.log(fusionSeries.address); - } - if (hre.network.name == "hardhat") { - await fusionSeries.createAsset( 500 ,"","https://ipfs.infura.io/ipfs/QmbXvKra8Re7sxCMAEpquWJEq5qmSqis5VPCvo9uTA7AcF",) - updateGraphAddress(fusionSeries.address, fusionSeries.deployTransaction.blockNumber, true) - } else { - //FusionSeries - await fusionSeries.deployTransaction.wait(6); - await verify(fusionSeries.address, ["www.xyz.com", tradehubAddr,AccessMasterAddr]); - //updateGraphAddress(fusionSeries.address, fusionSeries.deployTransaction.blockNumber, false) - } -} - -const verify = async (contractAddress: string, args: any[]) => { - console.log("Verifying contract...") - try { - await run("verify:verify", { - address: contractAddress, - constructorArguments: args, - }) - } catch (e: any) { - if (e.message.toLowerCase().includes("already verified")) { - console.log("Already verified!") - } else { - console.log(e) - } - } -} - -function updateGraphAddress(fusionSeriesAddr: string,startBlock: number | undefined, local: boolean) { - const urlFusionSeriesSubgraphLocal = local ? `subgraph/nftFusionSeries/subgraph.local.yaml` : `subgraph/nftFusionSeries/subgraph.yaml` - const umlFusionSeriesSubgraphLocal = yaml.load(fs.readFileSync(urlFusionSeriesSubgraphLocal, 'utf8')) as any - - umlFusionSeriesSubgraphLocal.dataSources[0].source.address = fusionSeriesAddr - - if (startBlock) { - umlFusionSeriesSubgraphLocal.dataSources[0].source.startBlock = startBlock - } - fs.writeFileSync(urlFusionSeriesSubgraphLocal, yaml.dump(umlFusionSeriesSubgraphLocal)); -} -// We recommend this pattern to be able to use async/await everywhere -// and properly handle errors. -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error); - process.exit(1); - }); diff --git a/scripts/deploy_instagen.ts b/scripts/deploy_instagen.ts deleted file mode 100644 index f6bc38d..0000000 --- a/scripts/deploy_instagen.ts +++ /dev/null @@ -1,60 +0,0 @@ -import hre, { ethers , run } from "hardhat" -import yaml from "js-yaml" -import fs from "fs" -async function main() { - const [_, buyer] = await hre.ethers.getSigners() - // We get the contract to deploy - const tradehubAddr = "0x0335DD44f170657FEe88D693989C4f01324a9116" - const accessMasterAddr ="0xbc9cD4bD303af002C0D65EDc5D6F5738be89B7D5" - let salePrice = await ethers.utils.parseEther("0.01") - let preSalePrice = await ethers.utils.parseEther("0.005") - // InstaGen CONTRACT - const InstaGenFactory = await hre.ethers.getContractFactory("InstaGen"); - const instaGen = await InstaGenFactory.deploy("InstaGen V1", "FEv4", tradehubAddr,accessMasterAddr ,salePrice,preSalePrice,86400,1000,50,"www.abc.com"); - await instaGen.deployed(); - console.log("FlowEdition Deployed to:", instaGen.address); - - if (hre.network.name == "hardhat") { - await instaGen.mint(1,{value : preSalePrice}); - //updateGraphAddress(instaGen.address, instaGen.deployTransaction.blockNumber, true) - } else { - //FlowCollection - await instaGen.deployTransaction.wait(6); - await verify(instaGen.address, ["FlowEdition V1", "FEv1", tradehubAddr, accessMasterAddr,salePrice,preSalePrice,84600,1000,50,"www.abc.com"]); - //updateGraphAddress(instaGen.address, instaGen.deployTransaction.blockNumber, false) - } -} - -const verify = async (contractAddress: string, args: any[]) => { - console.log("Verifying contract..."); - try { - await run("verify:verify", { - address: contractAddress, - constructorArguments: args, - }); - } catch (e: any) { - if (e.message.toLowerCase().includes("already verified")) { - console.log("Already Verified!"); - } else { - console.log(e); - } - } -}; - -function updateGraphAddress(instaGenAddr: string, startBlock: number | undefined ,local: boolean) { - const urlEditionSubgraphLocal = local ? `subgraph/nftEdition/subgraph.local.yaml` : `subgraph/nftEdition/subgraph.yaml` - const umlEditionSubgraphLocal = yaml.load(fs.readFileSync(urlEditionSubgraphLocal, 'utf8')) as any - - umlEditionSubgraphLocal.dataSources[0].source.address = instaGenAddr - if (startBlock){ - umlEditionSubgraphLocal.dataSources[0].source.startBlock = startBlock - } - fs.writeFileSync(urlEditionSubgraphLocal, yaml.dump(umlEditionSubgraphLocal)); -} - -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error); - process.exit(1); - }); \ No newline at end of file diff --git a/scripts/deploy_signatureSeries.ts b/scripts/deploy_signatureSeries.ts deleted file mode 100644 index 59b485f..0000000 --- a/scripts/deploy_signatureSeries.ts +++ /dev/null @@ -1,58 +0,0 @@ -import hre, { ethers , run } from "hardhat" -import yaml from "js-yaml" -import fs from "fs" -async function main() { - const [_, buyer] = await hre.ethers.getSigners() - // We get the contract to deploy - const tradehubAddr = "0x0335DD44f170657FEe88D693989C4f01324a9116" - const accessMasterAddr ="0xbc9cD4bD303af002C0D65EDc5D6F5738be89B7D5" - // FLOW EDITION CONTRACT - const SignatureSeries = await hre.ethers.getContractFactory("SignatureSeries"); - const signatureSeries = await SignatureSeries.deploy("SignatureSeries V1", "FEv4", tradehubAddr,accessMasterAddr); - await signatureSeries.deployed(); - console.log("SignatureSeries Deployed to:", signatureSeries.address); - - if (hre.network.name == "hardhat") { - await signatureSeries.createAsset("https://ipfs.infura.io/ipfs/QmbXvKra8Re7sxCMAEpquWJEq5qmSqis5VPCvo9uTA7AcF", 500) - //updateGraphAddress(signatureSeries.address, signatureSeries.deployTransaction.blockNumber, true) - } else { - //FlowCollection - await signatureSeries.deployTransaction.wait(6); - await verify(signatureSeries.address, ["SignatureSeries V1", "FEv1", tradehubAddr, accessMasterAddr]); - //updateGraphAddress(signatureSeries.address, signatureSeries.deployTransaction.blockNumber, false) - } -} - -const verify = async (contractAddress: string, args: any[]) => { - console.log("Verifying contract..."); - try { - await run("verify:verify", { - address: contractAddress, - constructorArguments: args, - }); - } catch (e: any) { - if (e.message.toLowerCase().includes("already verified")) { - console.log("Already Verified!"); - } else { - console.log(e); - } - } -}; - -function updateGraphAddress(signatureSeriesAddr: string, startBlock: number | undefined ,local: boolean) { - const urlEditionSubgraphLocal = local ? `subgraph/nftEdition/subgraph.local.yaml` : `subgraph/nftEdition/subgraph.yaml` - const umlEditionSubgraphLocal = yaml.load(fs.readFileSync(urlEditionSubgraphLocal, 'utf8')) as any - - umlEditionSubgraphLocal.dataSources[0].source.address = signatureSeriesAddr - if (startBlock){ - umlEditionSubgraphLocal.dataSources[0].source.startBlock = startBlock - } - fs.writeFileSync(urlEditionSubgraphLocal, yaml.dump(umlEditionSubgraphLocal)); -} - -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error); - process.exit(1); - }); diff --git a/scripts/deploy_tradehub_fusionSeries.ts b/scripts/deploy_tradehub_fusionSeries.ts deleted file mode 100644 index f83df8b..0000000 --- a/scripts/deploy_tradehub_fusionSeries.ts +++ /dev/null @@ -1,118 +0,0 @@ -// We require the Hardhat Runtime Environment explicitly here. This is optional -// but useful for running the script in a standalone fashion through `node