wormhole-examples/wormhole721
Emanuele Cesena c664796d5d Add Wormhole721: ERC721 impl using Wormhole 2022-07-15 12:17:34 -04:00
..
contracts Add Wormhole721: ERC721 impl using Wormhole 2022-07-15 12:17:34 -04:00
test Add Wormhole721: ERC721 impl using Wormhole 2022-07-15 12:17:34 -04:00
.gitignore Add Wormhole721: ERC721 impl using Wormhole 2022-07-15 12:17:34 -04:00
.prettierignore Add Wormhole721: ERC721 impl using Wormhole 2022-07-15 12:17:34 -04:00
.prettierrc.js Add Wormhole721: ERC721 impl using Wormhole 2022-07-15 12:17:34 -04:00
.solhint.json Add Wormhole721: ERC721 impl using Wormhole 2022-07-15 12:17:34 -04:00
LICENSE Add Wormhole721: ERC721 impl using Wormhole 2022-07-15 12:17:34 -04:00
README.md Add Wormhole721: ERC721 impl using Wormhole 2022-07-15 12:17:34 -04:00
arguments.js Add Wormhole721: ERC721 impl using Wormhole 2022-07-15 12:17:34 -04:00
hardhat.config.js Add Wormhole721: ERC721 impl using Wormhole 2022-07-15 12:17:34 -04:00
package-lock.json Add Wormhole721: ERC721 impl using Wormhole 2022-07-15 12:17:34 -04:00
package.json Add Wormhole721: ERC721 impl using Wormhole 2022-07-15 12:17:34 -04:00

README.md

Wormhole721 & Wormhole721Upgradable

Implementation of ERC721 and ERC721Upgradable NFTs using Wormhole to be natively cross-chain.

Usage

Install:

npm install @ndujalabs/wormhole721

NFT contact:

import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol";
import "@ndujalabs/wormhole721/contracts/Wormhole721Upgradeable.sol";
...

contract MyBeautifulNFT is
...
ERC721Upgradeable,
ERC721EnumerableUpgradeable,
Wormhole721Upgradeable
{
  ...
  function initialize(uint256 lastTokenId_, bool secondaryChain) public initializer {
    __Wormhole721_init("My Beautiful NFT", "MBNFT");
    __ERC721Enumerable_init();
    ...
  }
  ...
}

Examples

For a real-world example, see the Everdragons2 Genesis contact.