@soliditylabs/erc20-permit

1.0.0 • Public • Published

ERC20-permit

Package for implementing the ERC20 permit (EIP-2612). Unaudited, use at own risk.

Installation

  1. Install the package via NPM:
$ npm install @soliditylabs/erc20-permit --save-dev

Or Yarn:

$ yarn add @soliditylabs/erc20-permit --dev
  1. Import it into your ERC-20 contract:
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;

import {ERC20, ERC20Permit} from "@soliditylabs/erc20-permit/contracts/ERC20Permit.sol";

contract ERC20PermitToken is ERC20Permit {
    constructor (uint256 initialSupply) ERC20("ERC20Permit-Token", "EPT") {
        _mint(msg.sender, initialSupply);
    }

    function mint(address to, uint256 amount) public {
        _mint(to, amount);
    }

    function burn(address from, uint256 amount) public {
        _burn(from, amount);
    }
}

Running tests

  1. Clone the repository
$ git clone https://github.com/soliditylabs/ERC20-Permit
  1. Install the dependencies
$ cd ERC20-Permit
$ npm install
  1. Run Buidler Node
$ npx buidler node
  1. Run tests
$ npm test

Package Sidebar

Install

npm i @soliditylabs/erc20-permit

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

12.8 kB

Total Files

6

Last publish

Collaborators

  • markuswaas