Overview
This topic of discussion is an ERC token standard representing lot tokens. This new interface standardizes discrete holdings directly inside the token contract.
Issuance Identifiers
ERC-7752 is an ERC-1155 Multi-Token where each tokenId
a distinct acquisition of tokens. Each token lot has a sole owner.
Rationale
Assigning a unique tokenId
to all token lots makes it easier to access detailed data related to vesting schedules, lockups, and financial accounting.
Use Cases
Businesses can use ERC-7752 to represent many types of securities, including stock, investment fund interests, employee stock options, debt instruments, and convertibles. Capitalization (as in the accounting method of recording the cost of an asset) and capital gains accounting and reporting can be done onchain.
Individuals can use ERC-7752 to tokenize personal assets like their home, a boat, or other property.
Events can be indexed to form a more complete financial report of onchain accounts.
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.17;
/**
* @title ERC-7752 Lot Token Standard
* @dev See https://eips.ethereum.org/EIPS/eip-7752
* @notice Interface for the Lot Token contract, defining the essential functions and events.
*/
interface ILotToken {
// ------------------------------------------------------------------------
// Data Structures
// ------------------------------------------------------------------------
struct Lot {
bytes32 parentLotId; // Parent lot (0x0 if none).
uint96 quantity; // Quantity of the asset in the lot.
uint96 costBasis; // Cost basis per unit.
uint64 acquisitionDate; // Original acquisition timestamp.
uint64 lastUpdate; // Last update timestamp.
bool isValid; // Whether the lot is currently active.
address owner; // Owner of the lot
}
// ------------------------------------------------------------------------
// Events
// ------------------------------------------------------------------------
/**
* @notice Emitted when a new lot is created (initial issuance or partial sale).
* @param owner The user who owns this lot.
* @param lotId The unique hash-based identifier of the lot.
* @param parentLotId The lotId from which this lot originated (0x0 if none).
* @param quantity The quantity in this new lot.
* @param costBasis The cost basis per unit.
* @param acquisitionDate The original acquisition date of the lot.
* @param lastUpdate The timestamp when this lot was created/updated.
*/
event LotCreated(
address indexed owner,
bytes32 indexed lotId,
bytes32 indexed parentLotId,
uint96 quantity,
uint96 costBasis,
uint64 acquisitionDate,
uint64 lastUpdate
);
/**
* @notice Emitted when a lot is transferred from one owner to another.
* @param lotId The ID of the lot being transferred.
* @param from The address transferring the lot.
* @param to The address receiving the lot.
* @param quantity The quantity being transferred.
*/
event LotTransferred(bytes32 indexed lotId, address indexed from, address indexed to, uint96 quantity);
/**
* @notice Emitted when a lot is adjusted, creating a new lot from an old one.
* @param oldLotId The ID of the original lot.
* @param newLotId The ID of the new adjusted lot.
* @param operator The address performing the adjustment.
* @param newQuantity The new quantity of the adjusted lot.
* @param newCostBasis The new cost basis of the adjusted lot.
* @param reason The reason for the adjustment.
*/
event LotAdjusted(
bytes32 indexed oldLotId,
bytes32 indexed newLotId,
address operator,
uint96 newQuantity,
uint96 newCostBasis,
string reason
);
/**
* @notice Emitted when a lot is invalidated.
* @param lotId The ID of the lot being invalidated.
*/
event LotInvalidated(bytes32 indexed lotId);
/**
* @notice Emitted when an operator is approved for all owned lots.
* @param owner The owner of the lot.
* @param operator The operator being approved.
* @param approved Whether the operator is approved.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @notice Emitted when a lot is approved for a specific operation.
* @param lotId The ID of the lot being approved.
* @param owner The owner of the lot.
* @param spender The spender being approved.
* @param amount The amount being approved.
*/
event LotApproval(bytes32 indexed lotId, address indexed owner, address indexed spender, uint96 amount);
// ------------------------------------------------------------------------
// Core Functions
// ------------------------------------------------------------------------
/**
* @dev Returns the name of the token.
* @return The name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the prefix of the token.
* @return The prefix of the token.
*/
function prefix() external view returns (string memory);
/**
* @dev Sets the name of the token.
* @param _name The name of the token.
*/
function setName(string memory _name) external;
/**
* @dev Sets the prefix of the token.
* @param _prefix The prefix of the token.
*/
function setPrefix(string memory _prefix) external;
/**
* @dev Creates a brand-new lot (e.g., an initial issuance) for a user.
* @param owner The owner of the lot.
* @param quantity The total quantity for this lot.
* @param costBasis The cost basis per unit.
* @param acquisitionDate The original acquisition date.
* @return lotId The unique ID of the new lot.
*/
function createLot(address owner, uint96 quantity, uint96 costBasis, uint64 acquisitionDate)
external
returns (bytes32 lotId);
/**
* @dev Transfers a lot or partial lot from 'from' to 'to', physically/fully (raw).
* @param lotId The ID of the lot to transfer from.
* @param to The new owner.
* @param quantity The quantity to transfer.
*/
function transfer(bytes32 lotId, address to, uint96 quantity) external;
/**
* @dev Transfers a lot or partial lot from 'from' to 'to', physically/fully (raw).
* @param lotId The ID of the lot to transfer from.
* @param from The current owner of the lot.
* @param to The new owner.
* @param quantity The quantity to transfer.
*/
function transferFrom(bytes32 lotId, address from, address to, uint96 quantity) external;
/**
* @dev Creates a new lot as a child of an old lot, typically used for spin-offs,
* cost basis corrections, partial reclassifications, etc.
* @param oldLotId The old lot to be adjusted.
* @param newQuantity The quantity for the new lot.
* @param newCostBasis The cost basis for the new lot.
* @param reason A short string explaining the adjustment type.
* @return newLotId The ID of the newly created lot.
*/
function adjustLot(bytes32 oldLotId, uint96 newQuantity, uint96 newCostBasis, string calldata reason)
external
returns (bytes32 newLotId);
/**
* @dev Returns the stored data for a specific lot.
* @param lotId The lot ID to query.
* @return parentLotId Hash of the parent lot, or 0x0 if none.
* @return isValid Whether the lot is active.
* @return quantity The quantity.
* @return costBasis The cost basis.
* @return acquisitionDate The original acquisition timestamp (unmodified).
* @return lastUpdate The last time this lot was updated.
*/
function getLot(bytes32 lotId)
external
view
returns (
bytes32 parentLotId,
bool isValid,
uint96 quantity,
uint96 costBasis,
uint64 acquisitionDate,
uint64 lastUpdate
);
}
ERC Pull Request
TODO: Need to update the PR.