- Install foundry: https://book.getfoundry.sh/getting-started/installation
forge install
forge build
forge test
-
Replace name, symbol, baseURI in
script/LootBoxNFT.s.sol
with actual values. -
Create and fill .env file with content:
RPC_URL=
PRIVATE_KEY=
ETHERSCAN_KEY=
- Deploy and verify contract:
source .env
forge script script/LootBoxNFT.s.sol:LootBoxNFTScript --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast --verify --etherscan-api-key $ETHERSCAN_KEY -vvvv
cast send --private-key $PRIVATE_KEY --rpc-url $RPC_URL --from {OWNER_ADDRESS} {CONTRACT_ADDRESS} "mintTo(address)(uint256)" {RECIPIENT_ADDRESS}
cast send --private-key $PRIVATE_KEY --rpc-url $RPC_URL --from {OWNER_ADDRESS} {CONTRACT_ADDRESS} "setBaseURI(string memory)()" {NEW_BASE_URI}