diff --git a/src/HypLSP8.sol b/src/HypLSP8.sol index a225943..9c61ef5 100644 --- a/src/HypLSP8.sol +++ b/src/HypLSP8.sol @@ -19,6 +19,15 @@ contract HypLSP8 is LSP8IdentifiableDigitalAssetInitAbstract, TokenRouter { /** * @notice Initializes the Hyperlane router, LSP8 metadata, and mints initial supply to deployer. + * + * @dev The `_mintAmount` parameter is mostly used for a brand new NFT that want to exists only as a warp route. + * In other words, the entire warp route is deployed with HypLSP8, and no HypLSP8Collateral. + * For existing NFT collections (e.g: Bored Apes, CloneX, etc...) that already exist on the source chain, set this + * to 0. + * + * This `_mintAmount` parameter can be used to create an instantly bridgable NFT. + * By deploying the contract, mint the entire supply to themselves, and distribute. + * * @param _mintAmount The amount of NFTs to mint to `msg.sender`. * @param _name The name of the token. * @param _symbol The symbol of the token. @@ -35,15 +44,13 @@ contract HypLSP8 is LSP8IdentifiableDigitalAssetInitAbstract, TokenRouter { initializer { _MailboxClient_initialize(_hook, _interchainSecurityModule, _owner); - address owner = msg.sender; - _transferOwnership(owner); LSP8IdentifiableDigitalAssetInitAbstract._initialize( - _name, _symbol, owner, _LSP4_TOKEN_TYPE_TOKEN, _LSP8_TOKENID_FORMAT_NUMBER + _name, _symbol, _owner, _LSP4_TOKEN_TYPE_TOKEN, _LSP8_TOKENID_FORMAT_NUMBER ); for (uint256 i = 0; i < _mintAmount; i++) { - _mint(owner, bytes32(i), true, ""); + _mint(msg.sender, bytes32(i), true, ""); } } diff --git a/test/HypLSP8.t.sol b/test/HypLSP8.t.sol index e406201..14d7681 100644 --- a/test/HypLSP8.t.sol +++ b/test/HypLSP8.t.sol @@ -109,11 +109,11 @@ contract HypLSP8Test is HypTokenTest { lsp8Token.initialize(INITIAL_SUPPLY, address(noopHook), address(0), OWNER, NAME, SYMBOL); } - function testTotalSupply() public { + function testTotalSupply() public view { assertEq(lsp8Token.totalSupply(), INITIAL_SUPPLY); } - function testTokenOwnerOf() public { + function testTokenOwnerOf() public view { assertEq(lsp8Token.tokenOwnerOf(TOKEN_ID), ALICE); } diff --git a/test/LSP8Mock.sol b/test/LSP8Mock.sol index 8ca0998..bba0799 100644 --- a/test/LSP8Mock.sol +++ b/test/LSP8Mock.sol @@ -53,12 +53,12 @@ contract LSP8Mock is LSP8IdentifiableDigitalAsset { } } - function setData(bytes32 tokenId, bytes32 dataKey, bytes memory dataValue) public { + function setData(bytes32, /* tokenId */ bytes32 dataKey, bytes memory dataValue) public { _setData(dataKey, dataValue); } // Override for testing purposes - allows easy token ID verification - function tokenURI(bytes32 tokenId) public pure returns (string memory) { + function tokenURI(bytes32 /* tokenId */ ) public pure returns (string memory) { return "TEST-BASE-URI"; }