Quickstart

1. Deploy & Mint ERC-20

We can deploy a token that supports the derc-20 divisible protocol like the previous deploy/mint erc-20 etch.

{
  "p": "erc-20",
  "op": "deploy",
  "tick": "etch",
  "max": "21000000",
  "lim": "1000",
  "dlim": "1" // optional, minimum amount limit per div, default 1, dlim <= lim
}

In the deploy ethscription, we added an optional field dlim, which indicates the smallest unit that token can be divided into. The default value is 1. We expect it to be an integer not less than 1, but dlim must be less than lim.

{
  "p": "erc-20",
  "op": "mint",
  "tick": "etch",
  "id": "1",
  "amt": "1000"
}

2. Divide ERC-20

{
  "p": "derc-20",
  "op": "div",
  "eid": "0xd66f...2ab614f" // divided erc-20 mint ethscription id
  "id": "1", // divide id, range [1 - mint amt/dlim]
  "amt": "10" // divide amount, range [dlim - mint amt]
}

When eid is divided, the available balance of eid ethscription will be less amt. The div ethscription will have a transferable balance of amt amount.

The ethscription splitting is recursive, and the divided ethscriptions can be further divided.

3. Merge ERC-20

{
    "p":"derc-20",
    "op":"mg",
    "inputs":[
        "0xd66f...2ab614f",
        "0x7880...8acb78d"
    ],
    "output": "0x28d6...6dab8" // optional, merge to the specified ethscription, and generate a new ethscription by default
}

After the ethscriptions in the inputs are merged all available balance will be transferred to the output ethscription or the mg ethscription.

Note: Merged input ethscriptions cannot be used again.

Last updated