forked from storyprotocol/protocol-periphery
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* introduce tokenizer module interface * fix lint * fix compile * add name
- Loading branch information
1 parent
4e3a893
commit 71912fb
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity 0.8.26; | ||
|
||
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
|
||
contract OwnerableERC20 is ERC20 { | ||
constructor() ERC20("MockERC20", "MERC20") {} | ||
|
||
// can only mint by owner | ||
function mint(address to, uint256 amount) external { | ||
_mint(to, amount); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity 0.8.26; | ||
|
||
import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; | ||
import { ERC165Checker } from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; | ||
|
||
import { BaseModule } from "@storyprotocol/core/modules/BaseModule.sol"; | ||
import { AccessControlled } from "@storyprotocol/core/access/AccessControlled.sol"; | ||
import { IDisputeModule } from "@storyprotocol/core/interfaces/modules/dispute/IDisputeModule.sol"; | ||
|
||
/// @title Tokenizer Module | ||
/// @notice Tokenizer module is the main entry point for the IPA Tokenization and Fractionalization. | ||
/// It is responsible for: | ||
/// - Tokenize an IPA | ||
/// - Whitelist ERC20 Token Templates | ||
contract TokenizerModule is BaseModule, AccessControlled { | ||
using ERC165Checker for address; | ||
using Strings for *; | ||
|
||
/// @notice Returns the protocol-wide dispute module | ||
IDisputeModule public immutable DISPUTE_MODULE; | ||
|
||
constructor( | ||
address accessController, | ||
address ipAssetRegistry, | ||
address disputeModule | ||
) AccessControlled(accessController, ipAssetRegistry) { | ||
DISPUTE_MODULE = IDisputeModule(disputeModule); | ||
} | ||
|
||
function whitelistTokenTemplate(address tokenTemplate, bool allowed) external {} | ||
|
||
function tokenize(address ipId, address tokenTemplate, bytes calldata initData) external verifyPermission(ipId) {} | ||
|
||
function name() external pure override returns (string memory) { | ||
return "TOKENIZER_MODULE"; | ||
} | ||
} |