Skip to content

Commit

Permalink
Introduce Tokenizer Module (#143)
Browse files Browse the repository at this point in the history
* introduce tokenizer module interface

* fix lint

* fix compile

* add name
  • Loading branch information
kingster-will authored Dec 14, 2024
1 parent 4e3a893 commit 71912fb
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
13 changes: 13 additions & 0 deletions contracts/modules/tokenizer/OwnerableERC20.sol
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);
}
}
38 changes: 38 additions & 0 deletions contracts/modules/tokenizer/TokenizerModule.sol
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";
}
}

0 comments on commit 71912fb

Please sign in to comment.