Skip to content

Latest commit

 

History

History
79 lines (46 loc) · 4.38 KB

README.md

File metadata and controls

79 lines (46 loc) · 4.38 KB

Clearable Token

Build Status Coverage Status npm

This is the reference implementation of EIP Clearable Token. This implementation is being implemented by the iocash team in order to propose a standard em-token to the community. This implementation will change over time with the token standard and is not stable at the moment.

Feedback is appreciated and can given at the discussion of the EIP.

Summary

"In banking and finance, clearing denotes all activities from the time a commitment is made for a transaction until it is settled." [1]

Abstract

The clearing process turns the promise of a transfer into the actual movement of money from one account to another. A clearing agent decides if the transfer can be executed or not. Until the agent verifies the operation, the amount to be transferred is not deducted from the balance of the payer, but neither is it available for another operation and therefore ensures, that the execution of the transfer will be successful when it is executed. The Clearable agent can do three things: (1) execute the transfer: the money is transferred to the account that was set as target. (2) reject the transfer: the transfer will not take place and the money will be made available again in the origin account.(3) Mark the transfer as in process for a later decision on what to do with it. The payer can only cancel the transfer if it has not been marked as in process before.

Sequence diagrams

Clearable transfer executed

The following diagram shows the sequence of the clearable transfer creation and execution.

Clearable Token: Clearable transfer

Clearable transfer cancelled by payer

The following diagram shows the sequence of a clearable transfer creation and cancelled by the payer.

Clearable Token: Clearable transfer cancelled by payer

Clearable transfer rejected by agent

The following diagram shows the sequence of a clearable transfer creation and rejected by the notary.

Clearable Token: Clearable transfer rejected by agent

State diagram

Clearable Token: State Diagram

Install

npm install eip2018

Usage

To write your custom contracts, import it and extend it through inheritance.

pragma solidity ^0.5.0;

import 'eip2018/contracts/Clearable.sol';

contract MyClearable is Clearable {
    // your custom code
}

You need an ethereum development framework for the above import statements to work! Check out these guides for Truffle, Embark or Buidler.

Tests

To run the unit tests execute npm test.

Code coverage

To run the code coverage simply execute npm run coverage

[1] https://en.wikipedia.org/wiki/Clearing_(finance)