contractor icon indicating copy to clipboard operation
contractor copied to clipboard

The 🕴 CONTRACTOR will help you build your smart contracts!

🕴 The CONTRACTOR

Here to help you create your smart contracts!

The CONTRACTOR can help you:

  • Mint an ERC1155 on Opensea in just 3 easy steps
  • ... and more!

Required software and accounts

[Optional] For Local Testing:


🚀 Getting Started With ERC1155 Example

1. Fork the repository

Click here to fork and create your own project.

  • Fork Contractor

2. Create an .env file with the correct mnemonic and API keys

Inside the project directory, create a .env file containing the mnemonics and API keys. You can copy the env.example.

GANACHE_MNEMONIC=[not needed for demo]
TESTNET_MNEMONIC=[mnemonic for wallet with about 2 Rinkeby ETH]
INFURA_API_KEY=[yourInfuraKey]
PINATA_API_KEY=[yourPinataAPIKey]
PINATA_SECRET_API_KEY=[yourPinataSecretAPIKey]

3. Have 🕴 The CONTRACTOR create your contracts and mint your items

  • run yarn demo inside project directory, then wait a bit ⌛ The script will take a while to deploy the contracts on Rinkeby testnet.
  • Once finished, the logs will display the contract details. Copy the FactoryAddress to your clipboard
  • In a browser, go to https://rinkeby.opensea.io/get-listed/step-two and paste the contract address.
  • That's it! See the items you created on Opensea

Rinkeby Opensea Image


Creating Your Own Item Specs

  • Put all images inside erc155/images
  • Define the metadata and contract URI in erc1155/metadata.json

Minting Items

The demo mint parameters are defined in MyLootBox.sol, which pre-mints 1, 5, and 10 copies of the first 3 tokens respectively to the owner account.

This is a custom function based on the Opensea Factory implementation of ERC1155, more info on how to customize it can be found here.

Local Testing

For quicker development, you can use Ganache for local smart contract deployment and testing.

  • yarn sol:deploy deploys the smart contracts to ganache
    • GANACHE_MNEMONIC should be defined in the .env file
    • Make sure Ganache uses http://localhost:7545/ as the rpc url as specified in truffle-config.js
  • yarn sol:test runs tests in the test directory

Licenses

GitHub license