Time Lock Smart Contract – 时间锁定智能合约区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,Time Lock Smart Contract – 时间锁定智能合约区块链毕设代写 是一篇很好的国外资料

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)

  • Default locked period is 7 days
    => Locked period is changed (from 7 days) to 0 second in order to check result as soon as possible. (※ This change is only for test)
    https://github.com/masaun/time-lock-smart-contract/blob/master/test/test-local/TimeLock.test.js#L54-L66

 


【References】

  • Money Dance
    https://www.moneydance.io/ https://moneydance.devpost.com/ https://moneydance.devpost.com/details/resources?preview_token=dMiXFgKLi2UrXFT5QLBQy5STNJs4mFnRfJwrZl%2Bhlgc%3D

  • Poly Games
    • Concept of the “Time Lock Smart Contract”:
      https://docs.polyient.games/developer-resources/moneydance-hackathon

We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products. Learn more.


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)

  • Default locked period is 7 days
    => Locked period is changed (from 7 days) to 0 second in order to check result as soon as possible. (※ This change is only for test)
    https://github.com/masaun/time-lock-smart-contract/blob/master/test/test-local/TimeLock.test.js#L54-L66

 


【References】

  • Money Dance
    https://www.moneydance.io/ https://moneydance.devpost.com/ https://moneydance.devpost.com/details/resources?preview_token=dMiXFgKLi2UrXFT5QLBQy5STNJs4mFnRfJwrZl%2Bhlgc%3D

  • Poly Games
    • Concept of the “Time Lock Smart Contract”:
      https://docs.polyient.games/developer-resources/moneydance-hackathon

We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products. Learn more.

部分转自网络,侵权联系删除区块链源码网

www.interchains.cc

https://www.interchains.cc/18599.html

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 !
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » Time Lock Smart Contract – 时间锁定智能合约区块链毕设代写

提供最优质的资源集合

立即查看 了解详情