forked from chiru-labs/ERC721A
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f0d3dc
commit b938a6f
Showing
10 changed files
with
11,337 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,146 +1,9 @@ | ||
[![Docs][docs-shield]][docs-url] | ||
[![NPM][npm-shield]][npm-url] | ||
[![CI][ci-shield]][ci-url] | ||
[![Issues][issues-shield]][issues-url] | ||
[![MIT License][license-shield]][license-url] | ||
[![Coverage][coverage-shield]][coverage-url] | ||
<!-- OTHER BADGES --> | ||
<!-- [![Contributors][contributors-shield]][contributors-url] --> | ||
<!-- [![Forks][forks-shield]][forks-url] --> | ||
<!-- [![Stargazers][stars-shield]][stars-url] --> | ||
|
||
<!-- ANNOUNCEMENT --> | ||
|
||
> **📢 Version 4.x introduces several breaking changes. [Please refer to the documentation for more details.](https://chiru-labs.github.io/ERC721A/#/migration)** | ||
<!-- ABOUT THE PROJECT --> | ||
|
||
## About The Project | ||
|
||
The goal of ERC721A is to provide a fully compliant implementation of IERC721 with significant gas savings for minting multiple NFTs in a single transaction. This project and implementation will be updated regularly and will continue to stay up to date with best practices. | ||
|
||
The [Azuki](https://twitter.com/AzukiOfficial) team created ERC721A for its sale on 1/12/22. There was significant demand for 8700 tokens made available to the public, and all were minted within minutes. The network BASEFEE remained low despite huge demand, resulting in low gas costs for minters, while minimizing network disruption for the wider ecosystem as well. | ||
|
||
![Gas Savings](https://pbs.twimg.com/media/FIdILKpVQAEQ_5U?format=jpg&name=medium) | ||
|
||
For more information on how ERC721A works under the hood, please visit our [blog](https://www.azuki.com/erc721a). To find other projects that are using ERC721A, please visit [erc721a.org](https://www.erc721a.org) and our [curated projects list](https://github.com/chiru-labs/ERC721A/blob/main/projects.md). | ||
|
||
**Chiru Labs is not liable for any outcomes as a result of using ERC721A.** DYOR. | ||
|
||
<!-- Docs --> | ||
|
||
## Docs | ||
|
||
https://chiru-labs.github.io/ERC721A/ | ||
|
||
<!-- Upgradeable Version --> | ||
|
||
## Upgradeable Version | ||
|
||
https://github.com/chiru-labs/ERC721A-Upgradeable | ||
|
||
<!-- Installation --> | ||
|
||
## Installation | ||
|
||
```sh | ||
|
||
npm install --save-dev erc721a | ||
|
||
``` | ||
|
||
<!-- USAGE EXAMPLES --> | ||
|
||
## Usage | ||
|
||
Once installed, you can use the contracts in the library by importing them: | ||
|
||
```solidity | ||
pragma solidity ^0.8.4; | ||
import "erc721a/contracts/ERC721A.sol"; | ||
contract Azuki is ERC721A { | ||
constructor() ERC721A("Azuki", "AZUKI") {} | ||
function mint(uint256 quantity) external payable { | ||
// `_mint`'s second argument now takes in a `quantity`, not a `tokenId`. | ||
_mint(msg.sender, quantity); | ||
} | ||
} | ||
``` | ||
|
||
<!-- ROADMAP --> | ||
|
||
## Roadmap | ||
|
||
- [ ] Improve general repo and code quality (workflows, comments, etc.) | ||
- [ ] Add more documentation on benefits of using ERC721A | ||
- [ ] Maintain full test coverage | ||
|
||
See the [open issues](https://github.com/chiru-labs/ERC721A/issues) for a full list of proposed features (and known issues). | ||
|
||
<!-- CONTRIBUTING --> | ||
|
||
## Contributing | ||
|
||
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**. | ||
|
||
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". | ||
|
||
Don't forget to give the project a star! Thanks again! | ||
|
||
1. Fork the Project | ||
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`) | ||
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`) | ||
4. Push to the Branch (`git push origin feature/AmazingFeature`) | ||
5. Open a Pull Request | ||
|
||
<!-- ROADMAP --> | ||
|
||
### Running tests locally | ||
|
||
1. `npm install` | ||
2. `npm run test` | ||
|
||
<!-- LICENSE --> | ||
|
||
## License | ||
|
||
Distributed under the MIT License. See `LICENSE.txt` for more information. | ||
|
||
<!-- CONTACT --> | ||
|
||
## Contact | ||
|
||
- 2pm.flow (owner) - [@2pmflow](https://twitter.com/2pmflow) | ||
- location tba (owner) - [@locationtba](https://twitter.com/locationtba) | ||
- cygaar (maintainer) - [@cygaar_dev](https://twitter.com/cygaar_dev) | ||
- vectorized.eth (maintainer) - [@optimizoor](https://twitter.com/optimizoor) | ||
|
||
Project Link: [https://github.com/chiru-labs/ERC721A](https://github.com/chiru-labs/ERC721A) | ||
Forked https://github.com/chiru-labs/ERC721A to display gas savings when including the [ERC-2309](https://eips.ethereum.org/EIPS/eip-2309) consecutive transfer extension. By utilizing ERC-2309 we can acheive a truly constant gas price for minting 1 or 1 million NFTs. | ||
|
||
<!-- MARKDOWN LINKS & IMAGES --> | ||
As shown below, a negligible amount of gas is saved when minting 1 NFT, but when minting multiple NFTs the gas savings are tremendous and only increase as we scale up. | ||
|
||
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --> | ||
The pitfall of minting many NFTs at once using the standard ERC-721 spec is the `Transfer` event. There is no way around using a loop to emit the event for as many NFTs that were minted. The more NFTs that are minted the more costly it becomes. Using the `ConsecutiveTransfer` event specified in ERC-2309 we can mint as many NFTs as we want using O(1) complexity rather than O(n). | ||
|
||
[docs-shield]: https://img.shields.io/badge/docs-%F0%9F%93%84-blue?style=for-the-badge | ||
[docs-url]: https://chiru-labs.github.io/ERC721A/ | ||
[npm-shield]: https://img.shields.io/npm/v/erc721a.svg?style=for-the-badge | ||
[npm-url]: https://www.npmjs.com/package/erc721a | ||
[ci-shield]: https://img.shields.io/github/workflow/status/chiru-labs/ERC721A/ERC721A%20CI?label=build&style=for-the-badge | ||
[ci-url]: https://github.com/chiru-labs/ERC721A/actions/workflows/run_tests.yml | ||
[contributors-shield]: https://img.shields.io/github/contributors/chiru-labs/ERC721A.svg?style=for-the-badge | ||
[contributors-url]: https://github.com/chiru-labs/ERC721A/graphs/contributors | ||
[forks-shield]: https://img.shields.io/github/forks/chiru-labs/ERC721A.svg?style=for-the-badge | ||
[forks-url]: https://github.com/chiru-labs/ERC721A/network/members | ||
[stars-shield]: https://img.shields.io/github/stars/chiru-labs/ERC721A.svg?style=for-the-badge | ||
[stars-url]: https://github.com/chiru-labs/ERC721A/stargazers | ||
[issues-shield]: https://img.shields.io/github/issues/chiru-labs/ERC721A.svg?style=for-the-badge | ||
[issues-url]: https://github.com/chiru-labs/ERC721A/issues | ||
[license-shield]: https://img.shields.io/badge/License-MIT-green.svg?style=for-the-badge | ||
[license-url]: https://github.com/chiru-labs/ERC721A/blob/main/LICENSE.txt | ||
[coverage-shield]: https://img.shields.io/codecov/c/gh/chiru-labs/ERC721A?style=for-the-badge | ||
[coverage-url]: https://codecov.io/gh/chiru-labs/ERC721A | ||
[product-screenshot]: images/screenshot.png | ||
![Gas Savings](./savings.png) |
Oops, something went wrong.