Enoki Docs
Search…
Enoki Token Standard
The Enoki Wrapped Token is a proof of concept for a scalable fungible token on the Internet Computer. It implements sharding by account in order to run transactions in parallel.
It was created specifically for use in Enoki Exchange. It is very minimalistic (ex: does not keep transaction history) and subject to many modifications pending community consensus on a token standard.
It is loosely based on the DIP-20 Token Standard. It contains all DIP-20 methods, with some caveats:
  • name, symbol, getLogo, balanceOf, etc, work as expected.
  • balanceOf works as expected, except it is an update call, which takes longer and consumes cycles.
  • transfer is slow because it involves several canister calls.
    • shardTransfer should be used instead, which is called at the shard contract (and not the main contract).
  • approve and transferFrom will always fail, since this token standard uses subscriptions (aka notifications), and not approvals, for inter-contract calls.
    • transferAndCall (slow) and shardTransferAndCall (preferred) should be used instead.

Pending Features

  • Use tokens collected by this contract in fees in some sort of auction to have users refill cycles.
  • Scale up and down automatically.
  • To further optimize performance, create a function users can use to move to less utilised (and therefore faster) shards.
  • Change hashmap of all user accounts to big-maps to scale data storage.
  • Keep transaction history is kept by an archive canister (using a big-map) that listens (PubSub) to all transactions from all shards.
  • Establish paid priority shards, for example for the exchange and liquidity pools.
Copy link