Anton Bukov fb9cb6130c Improve ERC888MintableToken 7 months ago
contracts Add insert operation and test 7 months ago
lib Improve ERC888MintableToken 7 months ago
migrations Rename TypoToken to TypoLib 7 months ago
scripts Initial commit with project template 7 months ago
test Add insert operation and test 7 months ago
.babelrc Initial commit with project template 7 months ago
.editorconfig Initial commit with project template 7 months ago
.eslintignore Initial commit with project template 7 months ago
.eslintrc Initial commit with project template 7 months ago
.gitignore Initial commit with project template 7 months ago
.jshintrc Initial commit with project template 7 months ago
.solcover.js Initial commit with project template 7 months ago
.soliumignore Initial commit with project template 7 months ago
.soliumrc.json Initial commit with project template 7 months ago
.travis.yml Initial commit with project template 7 months ago
README.md Add recovery method and tests for smart contract wrong address 7 months ago
package-lock.json Initial commit with project template 7 months ago
package.json Initial commit with project template 7 months ago
truffle.js Initial commit with project template 7 months ago

README.md

TypoToken

ERC20 token extension allowing recovery it after transfering to wrong address

Installation

  1. Install truffle globally with npm install -g truffle
  2. Install ganache-cli globally with npm install -g ganache-cli
  3. Install local packages with npm install
  4. Run ganache in separate terminal scripts/rpc.sh
  5. Run tests with npm test

On macOS you also need to install watchman: brew install watchman

How it works

  1. Anyone whose destination address contains mistakes can reclaim lost funds
  2. Anyone who send tokens to wrong smart contract address can reclaim lost funds

Usage

Just inherit your token from TypoToken and pass argument of possible typos in destination address:

contract MyToken is StandardToken, TypoToken(3) {
    ...
}

Or:

contract MyToken is StandardToken, TypoToken {
    ...
    constructor() public TypoToken(3) {
        ...
    }
    ...
}

Or:

contract MyToken is StandardToken, TypoToken {
    ...
    constructor(uint _maxAllowedTypos) public TypoToken(_maxAllowedTypos) {
        ...
    }
    ...
}