Appearance
Token Ledger
Token Ledger are ownable and pausable ERC-1155 complaint contracts that also function as receivers for ERC-20 tokens.
These aid in managing multiple tokens associated with different token types by providing a robust set of features over the tokens deposited under them. They enable more fine-grain authority and control, simplifying interactions with multiple tokens associated with various token types and offering centralized management for ease of use.
How are Token Ledgers different from Token Type?
Token Types are unique identifiers for specific products or assets, represented as ERC-20 compliant FTs. They define the properties and metadata of a particular asset, allowing brands to register and manage their Stock Keeping Units (SKUs) on the blockchain. They are individual representations of products or services that can be issued, transferred, or burned.
Token Ledger, on the other hand, act as a protocol for bundling multiple tokens associated with various token types. They serve as a container or registry for these tokens, allowing users to manage, exchange, and interact with them in a unified manner.
Token Types are often owned and controlled by the entity that registers the SKU, typically a brand or manufacturer. They are the fundamental building blocks for managing specific products.
Token Ledger can be owned and managed by individuals or entities who wish to aggregate multiple tokens. They allow for centralized control over the bundled assets, enhancing the user experience in managing related tokens.
Types of Token Ledger: Regular vs. Locked
Token Ledger can be categorized into two main types: Regular Token Ledger and Locked Token Ledger.
In Regular Token Ledger:
- Anyone can deposit tokens.
- Both the token leger owner and depositors can withdraw, exchange, transfer, and attach attachments.
- Only the token leger owner can issue or burn tokens.
In Locked Token Ledger:
- Anyone can deposit tokens.
- Only the token leger owner can withdraw and transfer tokens.
- Both the token leger owner and depositors can exchange tokens.
For Pause/Unpause State:
- Only the Token type Owner can pause or unpause the token leger.
- When in the paused state, the only action that can be performed is unpause.
When should each type (Regular or Locked) be used?
Regular Token Ledger:
Ideal for scenarios where multiple parties need to manage tokens actively, such as in a dynamic trading environment or collaborative projects.
Locked Token Ledger:
Suitable for situations where only the token leger owner should manage token withdrawals and transfers, ensuring tighter control over asset movement.
Token Management in Token Ledger
The Token type owner has the authority to issue tokens under the token leger. This can help in establishing a base supply of tokens that can be managed within the token leger.
How can tokens be deposited into a token leger?
Receiving ERC-20 Tokens:
Token Ledger can accept a variety of ERC-20 Token type tokens through custom on-Receive hooks.When ERC-20 tokens are received, they are automatically marked to their respective senders. Deposits occur as transfers on the ERC-20 ledger of the Token type. Upon receiving a token transfer, the token leger invokes the on-Receive hook, which triggers the issuing of an equal amount of tokens for the sender on the ERC-1155 ledger. The token ID corresponds to the decimal representation of the Token type address.
How do token withdrawals work?
Tokens that a user owns within a token leger can be withdrawn back to the original Token type ledger. This allows users to access their assets outside the token leger framework whenever necessary.
What are the rules governing these operations?
To prevent malicious activities, the token leger protocol implements a default whitelisting mechanism to enhance security during token deposits. This ensures that only authorized and correctly structured tokens can be deposited, safeguarding the integrity of the token leger and its associated tokens.
Withdrawals are permitted only when the token leger is in an unpaused state. If the token leger is paused—such as when the Token type is explicitly locked (e.g., listed in a marketplace) or during a refutation process—withdrawals are not allowed. This ensures security and prevents unauthorized access to the tokens while under specific conditions.
Ownership and Control within a token leger
How is ownership of tokens managed within a token leger?
When tokens are deposited into a token leger, the ownership of the deposited ERC-20 tokens is transferred to the token leger contract. This transfer effectively means that the token leger contract becomes the new owner of these tokens, while the original token holders maintain a representation of their ownership through ERC-1155 tokens that are issued in the token leger
Ownership of the token leger:
The ownership of the token leger itself can be transferred.
The Token type owner has the ability to transfer ownership rights of the token leger to another address, enabling flexibility in the management of the token bundles held within the token leger.
Implications of Ownership Transfer:
- When ownership of the token leger changes, the new owner inherits all rights and responsibilities associated with the token leger, including the ability to manage deposits, withdrawals, and exchanges.
- This transfer of ownership does not affect the underlying tokens held within the token leger; the tokens remain managed under the token leger contract regardless of ownership changes.
Interactions With Marketplace
Token Ledger can be listed for sale or trade on marketplace, allowing users to easily exchange their bundled tokens with others. This functionality enables liquidity for the tokens held within a token leger, as users can engage in buying, selling, or trading without needing to withdraw individual tokens.
When listed in a marketplace, Token Ledger enter a paused state to prevent any modifications or transactions while they are available for trade. This ensures that the tokens contained within the token leger remain unchanged and secure until the listing is removed or a sale is completed.