For the complete documentation index, see llms.txt. This page is also available as Markdown.

Tokenizer

OclTokenizer Contract Documentation

Overview

The OclTokenizer turns a Lab into a liquid asset: it deploys one fractional ERC-20 IP Token (IPT) per Lab, gated by a signed membership agreement. The caller must be the Lab's controller β€” the current LabNFT owner β€” and each Lab can be tokenized exactly once. It also supports attaching a pre-existing ERC-20 ("bring your own token") as the Lab's IPT via a read-only wrapper.

Contract Details

Property
Value

Contract

OclTokenizer (UUPS proxy) β€” deploys LabToken clones

Type

UUPS Upgradeable Proxy + EIP-1167 clone factory

Chain

Base (8453) / Base Sepolia (84532)

Solidity

0.8.33

License

MIT

Deployments

Base Mainnet:

Contract
Address

Base Sepolia:

Contract
Address

How It Works

Tokenizing a Lab is a single transaction, authorized by two things:

  1. Lab control β€” controllerOf(labId) resolves live to LabNFT.ownerOf(labId). Only the Lab's current controller can tokenize, issue, or cap.

  2. A signed membership agreement β€” the caller signs the exact terms text for the agreement (identified by its S3 s3Key and SHA-256 contentHash) with a plain personal_sign (EIP-191) signature. The configured OclTermsPermissioner reconstructs the terms onchain via specificTermsV1() and verifies the signature β€” ECDSA first, then ERC-1271 for smart-account signers.

On success, the tokenizer deploys an EIP-1167 clone of the LabToken template, mints the initial supply to the caller, records it in the tokenized(labId) registry, and emits TokensCreated. The token name is derived automatically as Lab Tokens of Lab #<labId>; the caller chooses only the symbol. A second tokenization attempt for the same Lab reverts.

The Lab's assets are never taken into custody β€” the IPT is a fractional claim token associated with the Lab, and the LabNFT stays exactly where it is.

Functions

Write Functions

tokenize

Deploys the Lab's IP Token and mints the initial supply to the caller.

attachToken

"Bring your own token": registers a pre-existing ERC-20 (must have code and ≀ 18 decimals) as the Lab's IPT by wrapping it in a read-only WrappedLabToken that carries the Lab's metadata. issue/cap on a wrapped token revert.

issue

Mints additional supply of a Lab's IPT. Controller-only; reverts once the token is capped.

cap

Permanently freezes issuance for a Lab's IPT. Controller-only, irreversible.

Read Functions

  • controllerOf(uint256 labId) β€” the Lab's current controller (LabNFT.ownerOf(labId))

  • tokenized(uint256 labId) β€” the Lab's IPT contract, or the zero address if not tokenized

  • labNft(), permissioner(), labTokenImplementation(), wrappedLabTokenImplementation() β€” current configuration

Admin Functions (owner-only)

setPermissioner, setLabTokenImplementation, setWrappedLabTokenImplementation β€” configuration updates by the owner multisig. Ownership transfers are two-step (Ownable2Step) with an explicit cancelTransferOwnership, and renounceOwnership is permanently disabled.

Events

  • TokensCreated(labId, oclId, tokenContract, emitter, amount, s3Key, contentHash, name, symbol) β€” a Lab was tokenized

  • TokenWrapped(underlyingToken, wrappedLabToken, labId) β€” an existing ERC-20 was attached

  • PermissionerUpdated / LabTokenImplementationUpdated / WrappedLabTokenImplementationUpdated β€” admin configuration changes

Errors

  • MustControlLab() β€” caller is not the Lab's current controller

  • AlreadyTokenized() β€” the Lab already has an IPT

  • InvalidTokenContract() / InvalidTokenDecimals() β€” attached token has no code or more than 18 decimals

  • InvalidS3Key() β€” empty agreement key

  • ZeroAddress(), LabTokenNotControlledByTokenizer(), RenounceOwnershipDisabled()

Security Considerations

  • One token per Lab β€” the tokenized registry is committed before external calls (checks-effects-interactions), and re-tokenization reverts.

  • Live controller checks β€” authority follows the LabNFT: if the Lab changes hands, the new owner controls issuance and capping immediately.

  • Terms binding β€” the signed agreement is bound to the exact document bytes via its SHA-256 contentHash, and the terms text is reconstructed onchain, so the signature can't be replayed against a different document.

  • Hardened ownership β€” two-step transfers, renounce disabled, administered by a Molecule multisig.

  • IPT β€” the ERC-20 IP Token this factory deploys

  • Molecule Labs β€” the Lab primitive being tokenized

Resources

Last updated