Giter Site home page Giter Site logo

smartcontract's Introduction

Sample Hardhat Project

使用前请先在根目录下配置.env 文件

# address对应的密钥
ACCOUNT_PRIVATE_KEY=
# address
ACCOUNT_ADDRESS=
# 对应网络的RPC网址
RPC_URL=
# 对应生成的ERC721的智能合约的address(执行完脚本npx hardhat run scripts/deploy721.ts --network network后,log中会打印出对应的地址)
CONTRACT_ADDRESS_721=
# 对应生成的ERC1155的智能合约的address(执行完脚本npx hardhat run scripts/deploy1155.ts --network network后,log中会打印出对应的地址)
CONTRACT_ADDRESS_1155=
# 生成到哪个address下
NFT_TO_ADDRESS=
# NFT721的信息(下面的值可以使用,但当信息的拥有人删除对应的图片后,NFT的图片可能无法正常显示)
NFT_INFO_721=QmUBp3fLDqpYF6gAdN6f8iFDrMVPU551NHkXbei8gcoY5V

ERC721 智能合约源码

contracts/TestToken721.sol

ERC1155 智能合约源码

contracts/TestToken1155.sol

编译智能合约

npx hardhat compile

部署 ERC721 智能合约到对应网络

npx hardhat run scripts/deploy721.ts --network network

部署 ERC1155 智能合约到对应网络

npx hardhat run scripts/deploy1155.ts --network network

生成 ERC721NFT

npx hardhat run scripts/mintNFT721.ts --network network

生成 ERC1155NFT

npx hardhat run scripts/mintNFT1155.ts --network network

smartcontract's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.