Coder Social home page Coder Social logo

erc20's Introduction

NFT Project

NFT通过一个TokenId对应一个URI来确保资产的唯一性 TokenId和playerAddress是一对一的关系

ERC721合约交易

初始化合约时,会触发一次Transfer事件,会把最新的tokenId 和 player emit出来,后台及时监控到这个事件把内容存入数据库 contract.on('Transfer', (_, playerAddress, tokenId: BigNumber) => { console.log(playerAddress, tokenId.toNumber(), 'transfer') })

这个URI保存的地址的内容会变怎么办?

用ipfs保证资源不可变

比如URI:

其对应的图片内容如下

由此,我们用HeroFactory可以做个自己的NFT

tokenURI format

Mage:

{
    "name": "Mage",
    "description": "Mages wield powerful magic, casting spells like fireballs and shields to attack and protect.",
    "image": "xxx",
    "strength": "18",
    "health": "18",
    "dexterity": "18",
    "intellect": "18",
    "magic": "18",
}

Healer

{
    "name": "Healer",
    "description": "Healers specialize in mending wounds and restoring vitality, crucial in supporting allies during battles with their mending spells and protective charms.",
    "image": "xxx",
    "strength": "18",
    "health": "18",
    "dexterity": "18",
    "intellect": "18",
    "magic": "18",
}

Barbarians

{
    "name": "Barbarians",
    "description": "Barbarians thrive in combat, wielding raw strength and ferocity to overwhelm foes. They excel in close-quarters combat, relying on brute force and primal instincts to dominate the battlefield.",
    "image": "xxx",
    "strength": "18",
    "health": "18",
    "dexterity": "18",
    "intellect": "18",
    "magic": "18",
}

ERC20

erc20's People

Contributors

aeoluszane avatar

Watchers

 avatar

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.