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.
"In banking and finance, clearing denotes all activities from the time a commitment is made for a transaction until it is settled." [1]
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.
The following diagram shows the sequence of the clearable transfer creation and execution.
The following diagram shows the sequence of a clearable transfer creation and cancelled by the payer.
The following diagram shows the sequence of a clearable transfer creation and rejected by the notary.
npm install eip2018
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.
To run the unit tests execute npm test
.
To run the code coverage simply execute npm run coverage