Skip to content

Releases: badbabybearbots/ERC721B

0.2.1

14 Apr 08:57
2545300

Choose a tag to compare

What's Changed

Introducing Extensions. These can be found in the extensions folder.

ERC721BBaseTokenURI

Use this extension if you want token URIs to be determined with a base URI.
You need to manually call _setBaseURI(string memory) in your constructor
or in another function.

ERC721BBurnable

Use this extension if you want your tokens to be burnable. By default
it is not.

ERC721BContractURIStorage

Use this extension if you want your contract have an associated URI.
Marketplaces like OpenSea accept this. You need to manually call
_setContractURI(string memory) in your constructor or in another
function.

ERC721BPausable

Use this extension if you want manually pause minting and transferring.
You need to manually call _pause() and _unpause() in another function.

ERC721BSignedTransfer

Use this extension if you want want a cheaper way to approve transfers.
signedTransferFrom() is similar to safeTransferFrom() except it
accepts a signed message from the owner as authorization.

ERC721BStaticTokenURI

Use this extension if you want to assign static URIs to a token.

ERC721Metadata

Use this extension if you want to assign store the name and symbol in
your contract. We separated this out because it's cheaper to use a pure
function like function name() pure view returns(string memory).


Still the cheapest ERC721 standard without compromise.

·------------------|------------------|------------------|------------------·
|                  ·           ERC721 ·          ERC721A ·          ERC721B |
...................|..................|..................|...................
|           Deploy |        1,207,378 |        1,098,237 |        1,074,533 |
...................|..................|..................|...................
|           Mint 1 |           56,842 |           56,593 |           56,560 |
...................|..................|..................|...................
|           Mint 2 |           82,424 |           58,590 |           58,557 |
...................|..................|..................|...................
|           Mint 3 |          108,006 |           60,587 |           60,554 |
...................|..................|..................|...................
|           Mint 4 |          133,588 |           62,584 |           62,551 |
...................|..................|..................|...................
|           Mint 5 |          159,170 |           64,581 |           64,548 |
...................|..................|..................|...................
|         Transfer |           62,491 |           66,342 |           66,226 |
...................|..................|..................|...................
|             Burn |           19,611 |           65,419 |           57,501 |
·------------------|------------------|------------------|------------------·

Full Changelog: 0.2.0...0.2.1

0.2.0

18 Mar 08:33
4c86745

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.1.5...0.2.0

Provenance Preset

16 Feb 01:32

Choose a tag to compare

Added a preset for NFT collections that can be used like this.

import "erc721b/contracts/presets/ERC721BPresetProvenance.sol";

contract ERC721BMockProvenance is ERC721BPresetProvenance {
  uint256 constant public SALE_PRICE = 0.08 ether;
  uint64 constant public SALE_START_DATE = 1893456000;
  uint8 constant public SALE_MAX_PURCHASE = 1;
  uint256 constant public WHITELIST_PRICE = 0.08 ether;
  uint64 constant public WHITELIST_START_DATE = 1924992000;
  uint8 constant public WHITELIST_MAX_PURCHASE = 5;

  constructor(string memory uri, string memory cid) ERC721BPresetProvenance(
    // name
    "MyCollection", 
    // symbol
    "MYC",
    // base URI
    uri,
    // provenance hash
    cid,
    //MAX_SUPPLY
    10000,
    //white list info 
    WHITELIST_PRICE,
    WHITELIST_START_DATE,
    WHITELIST_MAX_PURCHASE,
    //sale info
    SALE_PRICE,
    SALE_START_DATE,
    SALE_MAX_PURCHASE
  ) {}
}

ERC721B now cheaper to deploy.

·------------------|------------------|------------------|------------------·
|                  ·           ERC721 ·          ERC721A ·          ERC721B |
...................|..................|..................|...................
|           Deploy |        1,208,218 |        1,210,541 |        1,054,413 |
...................|..................|..................|...................
|           Mint 1 |           56,842 |           56,890 |           56,578 |
...................|..................|..................|...................
|           Mint 2 |           82,424 |           59,149 |           58,595 |
...................|..................|..................|...................
|           Mint 3 |          108,006 |           61,408 |           60,612 |
...................|..................|..................|...................
|           Mint 4 |          133,588 |           63,667 |           62,629 |
...................|..................|..................|...................
|           Mint 5 |          159,170 |           65,926 |           64,646 |
...................|..................|..................|...................
|         Transfer |           62,491 |           66,389 |           66,193 |
...................|..................|..................|...................
|             Burn |           19,611 |           47,380 |           57,262 |
·------------------|------------------|------------------|------------------·

The following example is an example cost conversion from the gas above
in USD.

·------------------|------------------|------------------|------------------·
|                  ·           ERC721 ·          ERC721A ·          ERC721B |
...................|..................|..................|...................
|           Deploy | $       1,087.39 | $       1,089.48 | $         948.97 |
...................|..................|..................|...................
|           Mint 1 | $          51.15 | $          51.20 | $          50.92 |
...................|..................|..................|...................
|           Mint 2 | $          74.18 | $          53.23 | $          52.73 |
...................|..................|..................|...................
|           Mint 3 | $          97.20 | $          55.26 | $          54.55 |
...................|..................|..................|...................
|           Mint 4 | $         120.22 | $          57.30 | $          56.36 |
...................|..................|..................|...................
|           Mint 5 | $         143.25 | $          59.33 | $          58.18 |
...................|..................|..................|...................
|         Transfer | $          56.24 | $          59.75 | $          59.57 |
...................|..................|..................|...................
|             Burn | $          17.64 | $          42.64 | $          51.53 |
·------------------|------------------|------------------|------------------·

Everything Even More Affordable

14 Feb 07:42

Choose a tag to compare

New gas comparison. Please note we adjusted the gas limit from 200 to 50 gwei.

·------------------|------------------|------------------|------------------·
|                  ·           ERC721 ·          ERC721A ·          ERC721B |
...................|..................|..................|...................
|           Deploy |        1,208,218 |        1,210,541 |        1,093,716 |
...................|..................|..................|...................
|           Mint 1 |           56,842 |           56,890 |           56,607 |
...................|..................|..................|...................
|           Mint 2 |           82,424 |           59,149 |           58,624 |
...................|..................|..................|...................
|           Mint 3 |          108,006 |           61,408 |           60,641 |
...................|..................|..................|...................
|           Mint 4 |          133,588 |           63,667 |           62,658 |
...................|..................|..................|...................
|           Mint 5 |          159,170 |           65,926 |           64,675 |
...................|..................|..................|...................
|         Transfer |           62,491 |           66,389 |           66,420 |
...................|..................|..................|...................
|             Burn |           19,611 |           47,380 |           28,180 |
·------------------|------------------|------------------|------------------·

The following example is an example cost conversion from the gas above in USD. ($3,000.00 / ETH)

·------------------|------------------|------------------|------------------·
|                  ·           ERC721 ·          ERC721A ·          ERC721B |
...................|..................|..................|...................
|           Deploy | $       1,087.39 | $       1,089.48 | $         984.34 |
...................|..................|..................|...................
|           Mint 1 | $          51.15 | $          51.20 | $          50.94 |
...................|..................|..................|...................
|           Mint 2 | $          74.18 | $          53.23 | $          52.76 |
...................|..................|..................|...................
|           Mint 3 | $          97.20 | $          55.26 | $          54.57 |
...................|..................|..................|...................
|           Mint 4 | $         120.22 | $          57.30 | $          56.39 |
...................|..................|..................|...................
|           Mint 5 | $         143.25 | $          59.33 | $          58.20 |
...................|..................|..................|...................
|         Transfer | $          56.24 | $          59.75 | $          59.77 |
...................|..................|..................|...................
|             Burn | $          17.64 | $          42.64 | $          25.36 |
·------------------|------------------|------------------|------------------·

adding lastTokenId

10 Feb 07:04

Choose a tag to compare

0.1.3

updating repo references

First release tag

09 Feb 19:12

Choose a tag to compare

Gas prices on Ethereum have been consistently high for months, and the dev community needs to adapt. When popular NFT projects begin to mint, gas prices spike up, resulting in the entire ecosystem paying millions in gas fees to transact. The focus for the dev team has been to optimize our contract and enable our community to spend as little as possible in gas fees when minting.

The controversy ERC721A has certainly peeked interest in the community for achieving low mint costs for all, but had to sacrifice functionality and to increase gas costs in other places to do so.

We used OpenZeppelin's ERC721 as the base and implemented the intent of the ERC721A with very simple logic. Everything that works in ERC721 still works in ERC721B.

We've measured the gas costs and prices for minting, comparing OpenZeppelin's ERC721 vs ERC721A vs ERC721B. In our measurements, the same application-level logic is used, the only difference being the _safeMint function called.

Gas Report