Skip to content

Commit

Permalink
refactor: remove lsp4TokenType parameter from initialize function
Browse files Browse the repository at this point in the history
  • Loading branch information
CJ42 committed Oct 2, 2024
1 parent 1867997 commit fb520c9
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/HypLSP7.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/O
// libraries
import { TokenMessageForLSP7 } from "./TokenMessageForLSP7.sol";

// constants
import { _LSP4_TOKEN_TYPE_TOKEN } from "@lukso/lsp4-contracts/contracts/LSP4Constants.sol";

/**
* @title LSP7 version of the Hyperlane ERC20 Token Router
* @dev https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/token/HypERC20.sol
Expand All @@ -25,15 +28,19 @@ contract HypLSP7 is LSP7DigitalAssetInitAbstract, TokenRouter {
* @param _totalSupply The initial supply of the token.
* @param _name The name of the token.
* @param _symbol The symbol of the token.
*
* @dev The `LSP4TokenType` is hardcoded to type `Token` (= `0`) as all ERC20 tokens are of token type 0.
* This aims to keep the number of parameters consistent between hyperc20 and hypLSP7, so that the code of off-chain
* agents that call this function
* does not need to be modifed to add an extra parameter that would be irrelevant.
*/
function initialize(
uint256 _totalSupply,
string memory _name,
string memory _symbol,
address _hook,
address _interchainSecurityModule,
address _owner,
uint256 _lsp4TokenType
address _owner
)
external
initializer
Expand All @@ -43,7 +50,7 @@ contract HypLSP7 is LSP7DigitalAssetInitAbstract, TokenRouter {
name_: _name,
symbol_: _symbol,
newOwner_: _owner,
lsp4TokenType_: _lsp4TokenType,
lsp4TokenType_: _LSP4_TOKEN_TYPE_TOKEN,
isNonDivisible_: false // isNonDivisible set to `false` as will not be used anyway since decimals() is
// overriden
});
Expand Down

0 comments on commit fb520c9

Please sign in to comment.