Off-the-shelf Solidity smart contracts. Built with my beloved Solidity template.
- Designed for Solidity >=0.8.4
- Complementary to OpenZeppelin Contracts
- Promotes PRBMath as a fixed-point math library for Solidity
- Well-documented via NatSpec comments
- Thoroughly tested with Hardhat and Waffle
I created this library for my own use, to avoid having to maintain the same contracts in different repositories. If you find it useful too, that's a win-win.
This is experimental software and is provided on an "as is" and "as available" basis. I do not give any warranties and will not be liable for any loss, direct or indirect through continued use of this codebase.
With yarn:
$ yarn add @prb/contracts
Or npm:
$ npm install @prb/contracts
Once installed, you can use the contracts like this:
// SPDX-License-Identifier: Unlicense
pragma solidity >=0.8.4;
import "@prb/contracts/token/erc20/ERC20.sol";
import "@prb/contracts/token/erc20/ERC20Permit.sol";
contract MyToken is ERC20, ERC20Permit {
constructor(
string memory name_,
string memory symbol_,
uint8 decimals_
) ERC20Permit(name_, symbol_, decimals_) {}
}
Feel free to dive in! Open an issue, start a discussion or submit a PR.
You will need the following software on your machine:
In addition, familiarity with Solidity, TypeScript and Hardhat is requisite.
Install the dependencies:
$ yarn install
Then, follow the .env.example
file to add the requisite environment variables in the .env
file. Now you can start making changes.
While I set a high bar for code quality and test coverage, you shouldn't assume that this project is completely safe to use. The contracts have not been audited by a security researcher.
This is experimental software and is provided on an "as is" and "as available" basis. I do not give any warranties and will not be liable for any loss, direct or indirect through continued use of this codebase.
If you discover any security issues, please report them via Keybase.
- openzeppelin-contracts
- Alberto Cuesta Cañada's ERC20Permit and Orchestrated
Unlicense © Paul Razvan Berg