Skip to content

Commit

Permalink
chore: add comment about _mintAmount param + fix solc compiler warn…
Browse files Browse the repository at this point in the history
…ings
  • Loading branch information
CJ42 committed Nov 7, 2024
1 parent ad78c3b commit 8b8be7b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
15 changes: 11 additions & 4 deletions src/HypLSP8.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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, "");
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/HypLSP8.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions test/LSP8Mock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

Expand Down

0 comments on commit 8b8be7b

Please sign in to comment.