基于区块链的毕业设计Abyss Finance Lockup – 深渊金融锁定

本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计Abyss Finance Lockup – 深渊金融锁定 是一篇很好的国外资料

Abyss Finance Lockup

Abyss Lockup service allows you to lock any ERC20 token with strict period of withdrawal time:

  • All ERC20 tokens supported (LP tokens as well).
  • All forms of rebase are supported.
  • 1, 3, 6 and 12 months unlock time available.
  • Service is Free of charge when you hold the Abyss Token at all steps of 1, 3 and 6 months unlock time and without any requirements for a 12 month unlock time.

Contracts

Below is a list of contracts we use for this service:

SafeERC20, Ownable, ReentrancyGuard
Openzepellin smart contracts. The first one allows to transfer and to approve ERC20 tokens safely. The second one allows for managing ownership. The last one protects from re-entrance attacks.
AbyssLockup
A smart contract that stores tokens requested for withdrawal, as well as through which tokens are transferred from/to user and between contracts.
AbyssSafe1
The main smart contract responsible for deposits and withdrawal of tokens. 2592000 seconds (1 month) lockup delay setting should be applied on deployment.
AbyssSafe3
The main smart contract responsible for deposits and withdrawal of tokens. 7776000 seconds (3 months) lockup delay setting should be applied on deployment.
AbyssSafe6
The main smart contract responsible for deposits and withdrawal of tokens. 15552000 seconds (6 months) lockup delay setting should be applied on deployment.
AbyssSafe12
The main smart contract responsible for deposits and withdrawal of tokens. 31536000 seconds (1 year) lockup delay setting should be applied on deployment.

Installation

To run lockup service, install Homebrew, Node.js, Truffle, OpenZeppelin and pull the repository from GitHub:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" brew install node npm install -g truffle npm install -g @openzeppelin/contracts mkdir projects cd projects git clone https://github.com/abyssfinance/abyss-lockup cd abyss-lockup truffle init 

Setup your truffle environment, write migrations:

truffle develop migrate --reset 

Deployment (Mainnet)

Smart contracts should be deployed in such order:

  1. AbyssLockup.sol (100)
  2. AbyssSafe1.sol(0x0e8d6b471e332f140e7d9dbb99e5e3822f728da6, AbyssLockup_address, 2592000, 100000000000000000000000)
  3. AbyssSafe3.sol(0x0e8d6b471e332f140e7d9dbb99e5e3822f728da6, AbyssLockup_address, 7776000, 10000000000000000000000)
  4. AbyssSafe6.sol(0x0e8d6b471e332f140e7d9dbb99e5e3822f728da6, AbyssLockup_address, 15552000, 1000000000000000000000)
  5. AbyssSafe12.sol(0x0e8d6b471e332f140e7d9dbb99e5e3822f728da6, AbyssLockup_address, 31536000, 0)
  6. Call initialize(AbyssSafe1_address, AbyssSafe3_address, AbyssSafe6_address, AbyssSafe12_address) function from the owner on AbyssLockup contract.

How to Use

  1. Choose the ERC20 token that you want to lock.
  2. Approve AbyssLockup contract on that token’s smart contract for 115792089237316195423570985008687907853269984665640564039457584007913129639935 amount from your wallet.
  3. Use deposit() function on AbyssSafe1, AbyssSafe3, AbyssSafe6 or AbyssSafe12 to deposit tokens.
  4. Use request() function on AbyssSafe1, AbyssSafe3, AbyssSafe6 or AbyssSafe12 to request a withdrawal.
  5. Use cancel() function on AbyssSafe1, AbyssSafe3, AbyssSafe6 or AbyssSafe12 to cancel the withdrawal request.
  6. Use withdraw() function on AbyssSafe1, AbyssSafe3, AbyssSafe6 or AbyssSafe12 to withdraw tokens when lockup time passed after you had made a withdrawal request.

License

MIT

Discussion

For any concerns or suggestions visit us on Telegram to discuss.

For security concerns, please email security@abyss.finance.

© Copyright 2020, Abyss Finance

Refactoring + deposits for other user


Abyss Finance Lockup

Abyss锁定服务允许您锁定任何ERC20令牌,并有严格的提取时间:

  • 支持所有ERC20令牌(LP令牌)。
  • 支持所有形式的重基。
  • 提供1、3、6和12个月的解锁时间。
  • 当您在1、3和6个月解锁时间的所有步骤中持有深渊代币,并且12个月解锁时间无任何要求时,此项服务是免费的。

合同

下面是我们用于此服务的合同列表:

SafeERC20, Ownable, ReentrancyGuard
Openzepellin smart contracts. The first one allows to transfer and to approve ERC20 tokens safely. The second one allows for managing ownership. The last one protects from re-entrance attacks.
AbyssLockup
A smart contract that stores tokens requested for withdrawal, as well as through which tokens are transferred from/to user and between contracts.
AbyssSafe1
The main smart contract responsible for deposits and withdrawal of tokens. 2592000 seconds (1 month) lockup delay setting should be applied on deployment.
AbyssSafe3
The main smart contract responsible for deposits and withdrawal of tokens. 7776000 seconds (3 months) lockup delay setting should be applied on deployment.
AbyssSafe6
The main smart contract responsible for deposits and withdrawal of tokens. 15552000 seconds (6 months) lockup delay setting should be applied on deployment.
AbyssSafe12
The main smart contract responsible for deposits and withdrawal of tokens. 31536000 seconds (1 year) lockup delay setting should be applied on deployment.

安装

要运行锁定服务,请安装自制,节点.js,Truffle,OpenZeppelin并从GitHub中提取存储库:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" brew install node npm install -g truffle npm install -g @openzeppelin/contracts mkdir projects cd projects git clone https://github.com/abyssfinance/abyss-lockup cd abyss-lockup truffle init 

设置您的Truffle环境,写入迁移:

truffle develop migrate --reset 

部署(Mainnet)

智能合约应按以下顺序部署:

  1. 阿比斯洛克普.sol(100)abyssafe1.sol(0x0e8d6b471e332f140e7d9dbb99e5e3822f728da6,abyslockupu地址,2592000,1000000000000000000000)
  2. abyssafe3.sol(0x0e8d6b471e332f140e7d9dbb99e5822f728da6,abyslockupu地址,7776000,1000000000000000)
  3. abyssafe6.sol(0x0e8d6b471e332f140e7d9dbb99e5e3822f728da6,abyslockupu地址,15552000,1000000000000000)
  4. abyssafe12.sol(0x0e8d6b471e332f140e7d9dbb99e5e3822f728da6,abyslockupu地址,31536000,0)
  5. 调用初始化(abyssafe1u地址,abyssafe3u地址,abyssafe6u地址,Abyssafe12_address)函数。
  6. 选择要锁定的ERC20令牌。

如何使用

  1. 批准该代币智能合约上的AbysLockup合约,金额为11579208923731619542357098500868790785326998465640564039457584007913129639935,金额来自您的钱包。
  2. 对Abyssafe1、Abyssafe3、Abyssafe6或Abyssafe12使用deposit()函数来存放代币。
  3. 对Abyssafe1、Abyssafe3、Abyssafe6或Abyssafe12使用request()函数来请求撤回。
  4. 在Abyssafe1、Abyssafe3、Abyssafe6或Abyssafe12上使用cancel()函数取消取款请求。
  5. 在发出取款请求后经过锁定时间后,使用Abyssafe1、Abyssafe3、Abyssafe6或Abyssafe12上的draw()函数取款。你知道吗
  6. Use withdraw() function on AbyssSafe1, AbyssSafe3, AbyssSafe6 or AbyssSafe12 to withdraw tokens when lockup time passed after you had made a withdrawal request.

许可证

MIT

讨论

如有任何问题或建议,请致电我们进行讨论。

有关安全问题,请发送电子邮件security@abyss.finance。

©版权所有2020,Abyss Finance

Refactoring + deposits for other user

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

www.interchains.cc

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

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 ! QQ3039046426
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » 基于区块链的毕业设计Abyss Finance Lockup – 深渊金融锁定

提供最优质的资源集合

立即查看 了解详情