Coder Social home page Coder Social logo

har1s1m / time-lock-smart-contract Goto Github PK

View Code? Open in Web Editor NEW

This project forked from masaun/time-lock-smart-contract

0.0 0.0 0.0 49 KB

【Time Lock Smart Contract】This is a solidity smart contract that allows a user to send an amount of ERC20 token to a smart contract that takes custody of the asset for a pre-determined amount of time (e.g. 7 days) and issues a redemption token.

Shell 2.06% Solidity 40.54% JavaScript 57.40%

time-lock-smart-contract's Introduction

Time Lock Smart Contract


【Introduction of Time Lock Smart Contract】

  • Time Lock Smart Contract
    • This is a solidity smart contract that allows a user to send an amount of ERC20 token to a smart contract that takes custody of the asset for a pre-determined amount of time (e.g. 7 days) and issues a redemption token (that symbol is "RDT" ).
      (A redemption token is similar to liquidity provider tokens in systems like Uniswap).

    • At the end of the pre-determined time window, the contract should allow the user to reclaim the asset using by exchanging the redemption token for the original amount of asset.

 


Tech stack

  • Solidity v0.6.12
  • Truffle v5.1.52
  • web3.js v1.2.1
  • Node.js v11.15.0

 


Setup

① Install modules

$ npm install

② Run ganache-cli

(Please make sure whether port number is 8545 or not)

$ ganache-cli

③ Compile & migrate contracts

$ npm run migrate:local

④ Test contracts

$ npm run test:local

 


【Remarks】:Test of the time lock contract

  • Using 2 ERC20 Tokens
    • DAI mock token (symbol: DAI) as the original asset.
    • Redemption token (symbol: RDT)

 


【References】


time-lock-smart-contract's People

Contributors

masaun 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.