Giter VIP home page Giter VIP logo

erc1155-maturity's Introduction

ERC-1155 Maturity

ERC-1155 Maturity is an implementation of ERC-1155 that reduces the token balance size to uint224 (from uint256) and adds an uint32 maturity time.

The maturity feature creates a soft-lock effect for newly minted token balances. Once the maturity time has elapsed, the balance becomes matured and fully fungible. However, until that time, the balance is only partly fungible and subject to the following rules:

  • A zero balance is a fully matured balance.
  • A balance with a maturity time equal to or older than block.timestamp is a fully matured balance.
  • A maturing balance can be divided into smaller balances with the same maturity time.
  • A less matured balance cannot be transferred or merged into a more mature balance.
  • A more mature balance can be transferred to and merged into a less matured balance, resulting in a balance with a later maturity time.

The maturity time can be queried using the IERC1155Maturity interface:

interface IERC1155Maturity is IERC1155 {
    /**
     * @dev Returns the maturity time of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function maturityOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {maturityOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function maturityOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);
}

erc1155-maturity's People

Contributors

frangio avatar nventuro avatar amxx avatar maraoz avatar renovate[bot] avatar dependabot-preview[bot] avatar shrugs avatar augustol avatar zergity avatar izqui avatar aniket-engg avatar makoto avatar ernestognw avatar facuspagnuolo avatar theethernaut avatar adklempner avatar jakub-wojciechowski avatar spalladino avatar azavalla avatar martriay avatar abcoathup avatar githubpang avatar demibrener avatar pcaversaccio avatar julianmrodri avatar rudygodoy avatar k06a avatar fulldecent avatar dependabot[bot] avatar berlinp avatar

erc1155-maturity's Issues

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.