Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

🎨 Draw your own NFTs

License

NotificationsYou must be signed in to change notification settings

cazala/eth-pictures

Repository files navigation

This tool is an experiment I did to play with decentralized infrastructure.

The images are uploaded toIPFS, and an NFT (non-fungible token) is minted in the Ethereum blockchain to represent each picture.

Each token is ownable, transferrable, tradable and unique.

The gallery data is pulled fromOpenSea's API.

Setup

  1. Environment variables
$ mv .env.example .env

Add yourREACT_APP_INFURA_TOKEN

  1. Install dependencies
$ npm install
  1. Start dev-server
$ npm start
  1. Production build
$ npm run build

Deploy your own contract

You need to fill theMNEMONIC andREACT_APP_INFURA_TOKEN environment variables in your.env file:

MNEMONIC="bunker satoshi food..."REACT_APP_INFURA_TOKEN=b013...

Then useopenzeppelin create command and follow the interactive steps to deploy your contract.

To use this new contract just update theREACT_APP_CONTRACT_ADDRESS environment variable.

Modifying the contract

If you make changes tocontracts/EthPictures.sol you will need to do the following afterwards:

  1. Compile contracts
$ npm install -g @openzeppelin/cli$ openzeppelin compile
  1. Generate TypeScript interfaces
$ npm run contracts

If you have problems compiling your app after this, check out theTroubleshooting section.

Rinkeby

To use the Rinkeby testnet you need to point to a Rinkeby contract (you can deploy your own or use the one shown below), and also point to OpenSea's rinkeby API, like this:

REACT_APP_CONTRACT_ADDRESS=0xd9284B013f9237BAA3d884dca36FA1658430b178REACT_APP_OPENSEA_API=https://rinkeby-api.opensea.ioREACT_APP_OPENSEA_URL=https://rinkeby.opensea.io

That address is an actual instance of the contract deployed to Rinkeby:link to Etherscan.

Troubleshooting

If your build is failing due to a problem withsrc/contracts/EthPicturesAbi.ts try typing the ABI asany, by changing the last line in that file to the following:

]as any)

[8]ページ先頭

©2009-2025 Movatter.jp