EIPs Explained

ERC-1462 · Stagnant · ERC · 2018-10-01

ERC-1462: Base Security Token

A deliberately minimal ERC-20/ERC-777 extension for security tokens: four check functions that gate transfers, mints and burns with status codes, plus a way to attach legal documents.

What problem does it solve?

Tokenised securities have to obey rules a normal token ignores: only KYC/AML-verified investors may hold them, transfers can be frozen during a legal dispute, and the token should be tied to off-chain legal paperwork. In 2018 several security-token standards existed, but the authors felt they bundled too many project- or market-specific features.

ERC-1462 defines the smallest common base: hooks that let an issuer approve or reject each operation, and a document registry. Everything else is left to each project.

How it works

On top of ERC-20 (or ERC-777) the token adds:

function checkTransferAllowed(address from, address to, uint256 value) view returns (byte);
function checkTransferFromAllowed(address from, address to, uint256 value) view returns (byte);
function checkMintAllowed(address to, uint256 value) view returns (byte);
function checkBurnAllowed(address from, uint256 value) view returns (byte);

function attachDocument(bytes32 name, string uri, bytes32 contentHash) external;
function lookupDocument(bytes32 name) external view returns (string, bytes32);
  • The check functions return an ERC-1066 status code rather than a boolean: 0x11 (Allowed), 0x10 (Disallowed), or a more specific issuer code. This makes rejections easier to debug.
  • transfer must consult checkTransferAllowed; transferFrom and approve must consult checkTransferFromAllowed; mint/burn, if present, consult their checks. If not allowed, the operation reverts.
  • By default (not overridden) every check returns 0x11, so the token behaves like a plain ERC-20 in ordinary wallets.
  • Check logic may use whitelists, registry contracts or oracles; the standard does not prescribe it.
  • attachDocument stores a name → (URI, hash) reference. Names must be unique and cannot be overwritten.

Sample code

A token that only lets whitelisted investors receive tokens:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract BaseSecurityToken is ERC20 {
    bytes1 constant ALLOWED = 0x11;
    bytes1 constant DISALLOWED = 0x10;
    mapping(address => bool) public kycPassed;

    constructor() ERC20("Example Share", "SHR") {}

    function checkTransferAllowed(address, address to, uint256) public view returns (bytes1) {
        return kycPassed[to] ? ALLOWED : DISALLOWED;
    }

    function transfer(address to, uint256 value) public override returns (bool) {
        require(checkTransferAllowed(msg.sender, to, value) == ALLOWED, "transfer not allowed");
        return super.transfer(to, value);
    }
}

Things to know

  • Status is Stagnant. It was never finalised.
  • byte and unsized string returns in the spec are pre-0.5 Solidity; modern code uses bytes1 and string memory.
  • The hashing algorithm for documents is not specified; it just must fit in 32 bytes.
  • For regulated tokens today, ERC-3643 (T-REX) is a Final standard with on-chain identity and compliance modules; ERC-1450 is another Final, more prescriptive design.

#token #security-token #compliance #kyc #erc20

Details

Authors
Maxim Kupriianov <[email protected]>, Julian Svirsky <[email protected]>
Status
Stagnant
Type
Standards Track / ERC
Created
2018-10-01
Requires

Machine-readable: Markdown · JSON