Add two deploy scripts for local and mumbai deployments, update hardhat config to match two types and package.json

This commit is contained in:
EmperorOrokuSaki 2022-12-02 00:35:10 +03:30
parent 2ae2dbd354
commit a590717021
7 changed files with 1211 additions and 10 deletions

View File

@ -17,4 +17,4 @@ module.exports = async ({ getNamedAccounts, deployments }) => {
};
//You can put an array of tags below. Tags can be anything and say when a this script should be run. So you can write different scripts for local, prod or other deploys
//For example when you run 'npx hardhat --network hardhat deploy --tags local' hardhat will run all deploy scripts that have the tag local, could be multiple dif scripts
module.exports.tags = [];
module.exports.tags = ['local'];

20
deploy/mumbai_deploy.js Normal file
View File

@ -0,0 +1,20 @@
module.exports = async ({ getNamedAccounts, deployments }) => {
const { deploy, log } = deployments;
const namedAccounts = await getNamedAccounts();
const { privatekey } = namedAccounts;
const deployResult = await deploy('FleekERC721', {
from: privatekey,
args: ['FleekSites', 'FLKSITE'],
});
if (deployResult.newlyDeployed) {
log(
`contract FleekSites deployed at ${deployResult.address} using ${deployResult.receipt.gasUsed} gas`
);
} else {
log(`using pre-existing contract FleekSites at ${deployResult.address}`);
}
};
//You can put an array of tags below. Tags can be anything and say when a this script should be run. So you can write different scripts for local, prod or other deploys
//For example when you run 'npx hardhat --network hardhat deploy --tags local' hardhat will run all deploy scripts that have the tag local, could be multiple dif scripts
module.exports.tags = ['mumbai'];

View File

@ -0,0 +1 @@
31337

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -100,11 +100,11 @@ module.exports = {
},
namedAccounts: {
deployer: {
default: `privatekey://${PRIVATE_KEY}`, // here this will by default take the first account as deployer
1: 0, // similarly on mainnet it will take the first account as deployer. Note though that depending on how hardhat network are configured, the account 0 on one network can be different than on another
default: 1, // here this will by default take the first account as deployer
1: 0,
},
player: {
default: 1,
privateKey: {
default: `privatekey://${PRIVATE_KEY}`,
},
},
solidity: {

View File

@ -1,24 +1,25 @@
{
"name": "sites_nfts",
"version": "1.0.0",
"name": "fleek_contracts",
"version": "0.0.1",
"description": "",
"main": "index.js",
"scripts": {
"test": "hardhat test",
"format": "prettier --write \"./**/*.{js,ts,sol}\"",
"deploy:mumbai": "node scripts/deploy.js --network polygon_mumbai --contract FleekERC721 --param \"Fleek Sites Test\" --param FST",
"deploy:local": "hardhat deploy --tags local",
"compile": "hardhat compile"
},
"repository": {
"type": "git",
"url": "git+https://github.com/FleekHQ/sites_nfts.git"
"url": "git+https://github.com/FleekHQ/contracts.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/FleekHQ/sites_nfts/issues"
"url": "https://github.com/FleekHQ/contracts/issues"
},
"homepage": "https://github.com/FleekHQ/sites_nfts#readme",
"homepage": "https://github.com/FleekHQ/contracts#readme",
"devDependencies": {
"@nomicfoundation/hardhat-toolbox": "^2.0.0",
"@nomiclabs/hardhat-ethers": "^2.2.1",