GithubHelp home page GithubHelp logo

token-timelock's Introduction

Token Timelock

About

Token timelock smart contract. Use /contracts/production/TimelockERC20.sol for lock ERC20 tokens.

TimelockERC20

This contract allows you to send some tokens, but receiver can't take them until the set date.

SafeERC20Timelock

This contract allows you to get accidentally sent balance back (by contacting with contract owner)

Usage

Sender should approve to send balance in ERC20 token using function approve(address _spender, uint _value)

  • _spender is your contract address
  • _value is number of tokens to send

Then sender can send tokens to contract function accept(address _for, uint _timestamp, uint _tvalue)

  • _for is recipient address.
  • _timestamp is date until recipient can't get his balance.
  • _tvalue is number of tokens to send

Then recipient should call release to get his balance using: function release(uint[] _timestamp, uint[] _value) Should be in order timestamp[n] -> value[n]

Contract owner can call: function saveLockedERC20Tokens(address _token, address _to, uint _amount) To restore accidentally sent tokens back to sender.

Testing

  • Run ganache-cli or other test RPC
git clone https://github.com/BANKEX/token-timelock.git
cd token-timelock
npm install
truffle test

token-timelock's People

Contributors

bykrab avatar snjax avatar v57 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.