基于区块链的毕业设计Digital Euro 😄 💶 – 数字欧元😄 💶

本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计Digital Euro 😄 💶 – 数字欧元😄 💶 是一篇很好的国外资料

Digital Euro 😄 💶

Digital Euro 😄 💶 - 数字欧元😄 💶

  • ETH Online Hackathon – EUR pegged stablecoin
  • digital-euro.eth

Node packages

  • hdwallet to to connect to a non-local ETH network mainnet, ropsten, kovan, etc. npm i @truffle/hdwallet-provider

  • webpack to connect web3 with any new or old wallet to our DApp Front-End npm i webpack

  • web3 npm i web3

truffle commands

some useful truffle commands and what they do:

truffle init                      // initialze a basic project truffle develop                   // run local truffle(ganache) blockcahin truffle compile                   // compiles all Smart Contracts and creates new artifacts (SmartContract.json, including abi & address) into a build folder truffle migrate                   // depploy Smart Contracts by using the migrations files in order 1, 2, ... truffle migrate --reset           // redeploy with new addresses truffle migrate --network kovan   // deploy to the kovan network truffle test                      // run tests and get results if SCs work as planned or not truffle console                   // start truffle console to interact with SCs 

User perspective

The user has EUR, DAI or ETH and wants to get Digital Euro = DEUR open the Digital Euro DApp (hosted on ENS) and connect with a wallet (Metamask):

  1. MINT
  • MINT shows the user his balance in DAI or ETH. He can type how many DEUR he wants to get into the form and get an estimate how many DAI or ETH he would have to spend on that.
  • next metamask opens the usually allowance window and lets the user set a max. amount of DAI or ETH that the Smart Contract is allowered to transfer on his behalf (this does NOT trigger a tx!)
  • after the approval is confirmd the user can submit the amount of DAI or ETH to get his DEUR. Then he can set the preferred gas fee and confirm the tx
  • after this confirmation the user has DEUR in his wallet and can use it in the SAFE or POOL functions or just use it elsewhere
  1. SAFE
  • Once the user aquired DEUR through the primary market (Digital Factory) or on a secondary market (uniswap, balancer, etc.) he can stake his DEUR into the SAFE function
  • Inside the SAFE function the DEURs still belong to the user, but are locked up and earning %APY for the USER
  • the user can un-stake his DEUR from the SAFE and collect 100% of his staked DEUR + the accumulated %APY
  1. POOL
  • If you have DEUR and or DANK Token you can stake these into any of the various liquidity pools (uniswap, balancer) and earn even a higher %APY
  • To do so follow the links provided in the POOL UI and stake your Tokens accordingly (externally on uniswap, balancer)
  • once you staked into any of these pools you have LP Token in your wallet and cna stake these into the POOL function similair but a bit more advanced as the SAFE option

Smart Contracts

Following main concept of the Digital Euro and the User Experience descreibed above we require several functions and Smart Contracts

  1. Digital Euro The Digital Euro (DEUR) is 1:1 pegged to EUR it starts with a totalSupply of zero and takes 100% collateral from each user minting DEUR (managed in the ‘Digital Factory’)

  2. Digital Factory The Digital Facotry has the right to:

  • mint/burn DEUR
  • transferFrom User to take DAI or ETH in to order to mint DEUR on behalf of the user
  • get the current price DAI/EUR or ETH/EUR from ‘Digital Price Oracle’ to mint the correct amount of DEUR
  1. Digital Price Oracle
  • In order to determine the correct price of DAI/DEUR or ETH/DEUR we need a reliable source for the current EUR price for each pair
  • sources could be:
    • Chainlink (require the SC to have and spend $LINK)
    • Balancer (SPOT price from XXX/EUR)
    • UMA
    • etc.
  1. Digital Bank Like most other stabelcoins there is the primary need for a second token which have several functions.
  • act a reserve to help stabilize the stablecoin keeping its peg
  • it could be used as a governance token, like a DAO to decided on the progression of the overall protocol
  • etc.
  1. Additonal Smart Contracts ???

  2. Open Zeppelin Smart Contracts Since we are using the vetted Open Zeppelin library to create some of the SCs above we need to make sure that they are installed in our node_modules one we import … any SCs we are able to use the inherited functions

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

Merge remote-tracking branch ‘origin/main’ into main


数字欧元😄 💶

Digital Euro 😄 💶 - 数字欧元😄 💶

  • hdwallet连接到非本地ETH网络mainnet、ropsten、kovan等。npm i@truffle/hdwallet提供商
  • 将web3与任何新或旧钱包连接到我们的DApp前端npm i webpack

节点包-欧元.eth
  • hdwallet连接到非本地ETH网络mainnet、ropsten、kovan等。npm i@truffle/hdwallet提供商
  • 将web3与任何新或旧钱包连接到我们的DApp前端npm i webpack
  • web3 npm i web3
  • MINT
  • MINT向用户显示其在DAI或ETH中的余额。他可以输入他想进入状态的多少德国元,并得到一个估计他将要花费多少戴或以太币。
  • next metamask打开“通常允许”窗口,并允许用户设置允许智能合约代表其传输的最大DAI或ETH金额(这不会触发tx!)
  • 审批确认后,用户可提交DAI或ETH金额,以获得其DEUR。然后,他可以设置首选的天然气费用并确认发送
  • 确认后,用户的钱包中有DEUR,可以在保险箱或游泳池功能中使用,或者在其他地方使用它
  • 一旦用户通过一级市场(数字工厂)或二级市场(uniswap、balancer等)获得DEUR可以将他的DEUR放入SAFE函数中
  • 在SAFE函数中,DEUR仍然属于用户,但被锁定,并为用户赚取%APY,
  • 用户可以从保险箱中取消其DEUR的股份,并收集其100%的DEUR+累积的%APY
  • 如果您有DEUR和/或DANK代币,您可以将这些股份投资到任何一个流动性池中(uniswap,平衡器)并获得更高的%APY
  • 为此,请访问POOL UI中提供的链接,并相应地将您的代币进行投资(在uniswap外部,均衡器)
  • 一旦您将LP代币存入任何一个池中,您的钱包中就有LP代币,cna将这些代币存入池功能中,与安全选项类似,但更高级一些。
  • 数字欧元(DEUR)与欧元的比例为1:1,从零开始,从每个造币用户那里获得100%的抵押品DEUR(在“数字工厂”中管理)
  • 数字工厂数字工厂有权:
  • 铸造/烧制DEUR
  • 从用户处转让DAI或ETH,以代表用户铸造DEUR。
  • 从“Digital price Oracle”获得当前价格DAI/EUR或ETH/EUR,以制造正确数量的DEUR
  • 数字价格Oracle
  • 为了确定DAI/DEUR或ETH/DEUR的正确价格,我们需要一个可靠的来源,以确定每对的当前欧元价格
  • 来源可以是:Chainlink(要求SC拥有并花费$LINK)平衡器(XXX/EUR的现货价格)UMA等。
  • Chainlink(要求SC拥有和花费$LINK)
  • 平衡器(现货价格为XXX/EUR)
  • UMA
  • 等。
  • 数字银行与大多数其他stabelcoins一样,主要需要第二个代币,该代币具有多种功能。
  • 作为一个储备来帮助稳定市场,保持其peg
  • 它可以作为一个治理令牌,就像决定整个协议进展的DAO一样。
  • 其他智能合约???
  • 打开齐柏林智能合约因为我们正在使用经过审核的开放齐柏林库来创建上面的一些SCs,我们需要确保它们安装在我们导入的节点模块中。。。我们可以使用继承函数的任何SCs
    • web3 npm i web3
    • MINT
    • MINT向用户显示其在DAI或ETH中的余额。他可以输入他想进入状态的多少德国元,并得到一个估计他将要花费多少戴或以太币。

    truffle commands

    一些有用的truffle命令及其作用:

    truffle init                      // initialze a basic project truffle develop                   // run local truffle(ganache) blockcahin truffle compile                   // compiles all Smart Contracts and creates new artifacts (SmartContract.json, including abi & address) into a build folder truffle migrate                   // depploy Smart Contracts by using the migrations files in order 1, 2, ... truffle migrate --reset           // redeploy with new addresses truffle migrate --network kovan   // deploy to the kovan network truffle test                      // run tests and get results if SCs work as planned or not truffle console                   // start truffle console to interact with SCs 

    User perspective

    用户拥有欧元、DAI或ETH,希望获得数字Euro=DEUR或打开数字Euro-DApp(托管在ENS上)并连接使用钱包(Metamask):

    1. next metamask打开“通常允许”窗口,并允许用户设置允许智能合约代表其传输的最大DAI或ETH金额(这不会触发tx!)
    • 审批确认后,用户可提交DAI或ETH金额,以获得其DEUR。然后,他可以设置首选的天然气费用并确认发送
    • 确认后,用户的钱包中有DEUR,可以在保险箱或游泳池功能中使用,或者在其他地方使用它
    • 一旦用户通过一级市场(数字工厂)或二级市场(uniswap、balancer等)获得DEUR可以将他的DEUR放入SAFE函数中
    • 在SAFE函数中,DEUR仍然属于用户,但被锁定,并为用户赚取%APY,
    1. 用户可以从保险箱中取消其DEUR的股份,并收集其100%的DEUR+累积的%APY
    • 如果您有DEUR和/或DANK代币,您可以将这些股份投资到任何一个流动性池中(uniswap,平衡器)并获得更高的%APY
    • 为此,请访问POOL UI中提供的链接,并相应地将您的代币进行投资(在uniswap外部,均衡器)
    1. 一旦您将LP代币存入任何一个池中,您的钱包中就有LP代币,cna将这些代币存入池功能中,与安全选项类似,但更高级一些。
    • 数字欧元(DEUR)与欧元的比例为1:1,从零开始,从每个造币用户那里获得100%的抵押品DEUR(在“数字工厂”中管理)
    • 数字工厂数字工厂有权:
    • 铸造/烧制DEUR

    Smart Contracts

    遵循数字欧元的主要概念和上面描述的用户体验,我们需要多个功能和智能合约

    1. 从用户处转让DAI或ETH,以代表用户铸造DEUR。
    2. 从“Digital price Oracle”获得当前价格DAI/EUR或ETH/EUR,以制造正确数量的DEUR
    • 数字价格Oracle
    • 为了确定DAI/DEUR或ETH/DEUR的正确价格,我们需要一个可靠的来源,以确定每对的当前欧元价格
    • 来源可以是:Chainlink(要求SC拥有并花费$LINK)平衡器(XXX/EUR的现货价格)UMA等。
    1. Chainlink(要求SC拥有和花费$LINK)
    • 平衡器(现货价格为XXX/EUR)
    • UMA
    1. 其他智能合约???
    • 打开齐柏林智能合约因为我们正在使用经过审核的开放齐柏林库来创建上面的一些SCs,我们需要确保它们安装在我们导入的节点模块中。。。我们可以使用继承函数的任何SCs
    • it could be used as a governance token, like a DAO to decided on the progression of the overall protocol
    • etc.
    1. 附加智能合约???

    2. 打开齐柏林智能合约因为我们正在使用经过审核的开放齐柏林库来创建上面的一些SCs,我们需要确保它们安装在我们导入的节点模块中。。。我们能够使用继承函数的任何SCs

    我们使用可选的第三方分析Cookie来了解您如何使用GitHub.com网站所以我们可以制造更好的产品。了解更多。

    Merge remote-tracking branch ‘origin/main’ into main

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

    www.interchains.cc

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

    区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 !
    区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » 基于区块链的毕业设计Digital Euro 😄 💶 – 数字欧元😄 💶

    提供最优质的资源集合

    立即查看 了解详情