An open API service indexing awesome lists of open source software.

https://github.com/maksandre/monster-drop


https://github.com/maksandre/monster-drop

Last synced: over 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# Monsters Drop 👾 👻 👹

## TLDR

#### Step-1. Set the deployer's private key

Set the `PRIVATE_KEY` variable to the `.env` file. See [`.env.example`](./.env-example). Top up its balance.

#### Step-2. Install packages and compile contracts

```sh
npm i
npm run compile
```

#### Step-3. Deploy to the Opal network

```sh
npx hardhat deploy --network opal
```

Save the collection address printed to the console. You'll need it to mint NFTs. You may also want to set `COLLECTION_ADDRESS` in the `.env` file.

#### Step-4. Mint an NFT to the Opal network

Provide the following params:

- `--addr` (optional): Collection's contract address. You've got it on step 3. This param is optional if you set the `COLLECTION_ADDRESS` environment variable to the `.env` file.
- `--to`: NFT owner. It can be an ethereum (0x...) address or a substrate (5Grwva...) address.

```sh
npx hardhat mint --addr 0x407fd72e995c2268bDedd2D1f03989Fec7307C0c --to 0x4B36849eB51288dB186fe83c3b00aBF8A008bD26 --network opal
```

## Check the code

- Contract: [`MonsterDrop.sol`](./contracts/MonsterDrop.sol).
- Ethers.js: [`tasks`](./tasks/index.ts).