Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ERC20 and ERC777 presets with fixed supply #2377

Closed
abcoathup opened this issue Oct 15, 2020 · 2 comments
Closed

Add ERC20 and ERC777 presets with fixed supply #2377

abcoathup opened this issue Oct 15, 2020 · 2 comments
Labels
good first issue Low hanging fruit for new contributors to get involved!

Comments

@abcoathup
Copy link
Contributor

馃 Motivation
Create simple ERC20 and ERC777 presets with fixed supply.
The benefits are:

  • Easy to deploy (including from Remix).
  • No access control (for minting/pausing), and hence no governance required.
  • Can be verified easily on public networks and then are verified for all.

馃摑 Details

Community members are creating their own simple ERC20 tokens, so it would be good if they could use a Preset from Contracts which wouldn't require any code changes.

To verify contracts as multi-file it is best to use Buidler Etherscan plugin (Truffle plugin is getting updated). This can be a challenge for community members deploying from Remix. A preset contract once verified on a network would be verified for all subsequent deployments.

The Simple ERC777 token example in the forum has 4K+ views so there is potential interest in an ERC777 preset too.
https://forum.openzeppelin.com/t/simple-erc777-token-example/746

Potential presets could look like the following:

Draft ERC20PresetFixedSupply

// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";

contract ERC20PresetFixedSupply is ERC20, ERC20Burnable {
    constructor(
        string memory name,
        string memory symbol,
        uint256 initialSupply
    ) public ERC20(name, symbol) {
        _mint(msg.sender, initialSupply);
    }
}

Draft ERC777PresetFixedSupply

// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;

import "@openzeppelin/contracts/token/ERC777/ERC777.sol";

contract ERC777PresetFixedSupply is ERC777 {
    constructor(
        string memory name,
        string memory symbol,
        uint256 initialSupply,
        address[] memory defaultOperators
    ) public ERC777(name, symbol, defaultOperators) {
        _mint(msg.sender, initialSupply, "", "");
    }
}
@frangio frangio added the good first issue Low hanging fruit for new contributors to get involved! label Oct 15, 2020
ashwinYardi added a commit to ashwinYardi/openzeppelin-contracts that referenced this issue Nov 3, 2020
@ashwinYardi
Copy link
Contributor

Hi @frangio @abcoathup ! Have submitted the PR .

Can you please take a look whenever possible and let me know if anything needs to be changed / added? Thanks!

frangio added a commit that referenced this issue Dec 2, 2020
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
@frangio
Copy link
Contributor

frangio commented Feb 12, 2021

Fixed in #2399

@frangio frangio closed this as completed Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Low hanging fruit for new contributors to get involved!
Projects
None yet
Development

No branches or pull requests

3 participants