Skip to content

Instantly share code, notes, and snippets.

@lushl9301
Created January 22, 2022 03:10
Show Gist options
  • Save lushl9301/07e6db8cae83d0dce67ae215209e998f to your computer and use it in GitHub Desktop.
Save lushl9301/07e6db8cae83d0dce67ae215209e998f to your computer and use it in GitHub Desktop.
npm install dotenv --save\
npx hardhat compile
npm install --save-dev hardhat
npm install --save-dev @nomiclabs/hardhat-etherscan\
npm install @openzeppelin/contracts
npx hardhat compile
npx hardhat compile
npm install --save-dev @nomiclabs/hardhat-ethers
npx hardhat compile
npx hardhat run --network rinkeby scripts/deploy-burner.js
npx buidler verify --network rinkeby CONTRACT_ADDRESS
@lushl9301
Copy link
Author

lushl9301 commented Jan 22, 2022

hardhat.config.js file

/**
 * @type import('hardhat/config').HardhatUserConfig
 */
module.exports = {
  solidity: "0.8.4",
};


/**
* @type import('hardhat/config').HardhatUserConfig
*/
require('dotenv').config();
require("@nomiclabs/hardhat-ethers");
require("@nomiclabs/hardhat-etherscan");
const {API_URL, RKB_URL, PRIVATE_KEY, ETHER_KEY } = process.env;
module.exports = {
  solidity: {
    version:  "0.8.4",
    settings: {
      optimizer: {
        enabled: true,
        runs: 2000,
        details: {
          yul: true,
          yulDetails: {
            stackAllocation: true,
            optimizerSteps: "dhfoDgvulfnTUtnIf"
          }
        }
      }
    },
  },
  defaultNetwork: "rinkeby",
  networks: {
    hardhat: {},
    rinkeby: {
      url: RKB_URL,
      accounts: [`0x${PRIVATE_KEY}`]
    },
  },
  etherscan: {
    apiKey: ETHER_KEY
  }
}

@lushl9301
Copy link
Author

.env file

API_URL = "https://eth-rinkeby.alchemyapi.io/v2/zavSkPSGFbMM0_LnKwAjxRlZlz0SpkBF"
RKB_URL = "https://rinkeby.infura.io/v3/6497e744a4c145d083056d552ad96a6e"
PRIVATE_KEY = "182a94583d01fd60c89b794a6165ad8ba1d156f998a00e5265b8a6ef4d2f1fdc"
ETHER_KEY = "ADD PRIVATE KEY"
PUBLIC_KEY = "Ether address"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment