🔹 You must have an active app on Alchemy
Get and save the
app key
🔹 You must have a crypto wallet, recommended
Metamask
Get and save the
private key
andpublic address key
🔹 Host front-end API (ngrok, vercel, etc)
Get and save the
URL
api endpoint
🔹 Change the Solidity Contract baseURI
value with URL
of API
function _baseURI() internal pure override returns (string memory) {
return "<URL>/api/erc721/";
}
🔹 Compile with HardHat to generate the artifacts
npx hardhat compile
> artifacts/
> @openzeppelin/contracts/
> build-info/
> contracts/Contract.sol
🔹 Change the hardhat.config.js
value KEYs to Alchemy and Metamask keys
require("@nomiclabs/hardhat-ethers");
module.exports = {
solidity: "0.8.0",
defaultNetwork: "ropsten",
networks: {
hardhat: {},
ropsten: {
url: <ALCHEMY_KEY>,
accounts: [`0x${<METAMASK_PRIVATE_KEY>}`]
}
}
};
🔹 Run npm deploy
and see the magic happen 🌟