🎩 MagicBet – Contracts – 🎩 MagicBet-合同区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,🎩 MagicBet – Contracts – 🎩 MagicBet-合同区块链毕设代写 是一篇很好的国外资料

🎩 MagicBet – Contracts

Loseless Ethereum Betting

🎩       MagicBet - Contracts - 🎩       MagicBet-合同 🎩       MagicBet - Contracts - 🎩       MagicBet-合同 🎩       MagicBet - Contracts - 🎩       MagicBet-合同

MagicBet is a no loss betting platform, built on Ethereum. It allows users to make bets on future events and outcomes without the need to risk their initial stake.

All stakes accrue interest until the event which is bet on happens. The interest payment is then shared among the winners, and all participants (winners and losers) get their stakes back – thus allowing users to save money in a fun manner.

Users are minted ERC20 tokens equalling the Dai bet, which must be burnt when receiving their stake back (and winnings, if any).

This project contains the Ethereum smart contracts, the client code can be found under the following link.

Corresponding Client

Setup

Given that NodeJS and npm are installed, clone the repo and then run npm install inside the root directory to install the dependencies.

For the environment variables you need to create a .env file in the root directory which contains the keys MNEMONIC and INFURA_KEY with your personal data like this:

INFURA_KEY=your_key_4_infura MNEMONIC=the mnemonic phrase for your wallet 

Testing

To run the unit tests, enter:

npx buidler test

Deploy

To deploy to the Kovan test net, run

truffle migrate --reset --network kovan

This will deploy the MBMarketFactory contract. Copy the contents of the folder abis/ over to the Client repo into src/abis/. In addition, take a note of the address of the deployed MBMarketFactory.sol, and update the relevant variable in src/utils/addresses.ts (line 6 for kovan), also in the Client repo. Then follow the ReadMe of that repo to run the app locally.

Behind the scenes

Magic Bet uses a factory contract, which itself deploys the markets, and any corresponding ERC20s. The above will deploy the factory contract only, the market contracts are deployed by the front end.

All Dai that is sent to the contract is sent to Aave, whereby it begins to accrue interest. Interest and principal is withdrawn from Aave when users withdraw – the contract never holds funds for more than a single block.

The contract has full Uniswap V2 integration, allowing users to pay in Eth instead of Dai, should they wish.

The contract uses realitio as an Oracle. For continued disputes, the decentralised court Kleros has been set as an arbitrator. The Magic Bet team have zero ability to set the outcome. For details on how the oracle works, check out this Medium article


🎩 MagicBet – Contracts

Loseless Ethereum Betting

<🎩       MagicBet - Contracts><🎩       MagicBet - Contracts><🎩       MagicBet - Contracts><🎩       MagicBet - Contracts><🎩       MagicBet - Contracts><🎩       MagicBet - Contracts>

MagicBet是一个建立在以太坊eth之上的无损失投注平台。它允许用户在未来的事件和结果上下注,而不需要冒最初的风险。

所有赌注都会产生利息,直到下注的事件发生为止。利息支付然后在赢家之间分享,所有参与者(赢家和输家)都会拿回他们的股份,这样用户就可以以一种有趣的方式省钱。

用户铸造的ERC20代币相当于Dai赌注,必须在收到他们的赌注(以及赢款,如果有的话)时烧掉。

此项目包含以太坊eth智能合约,客户代码可在以下链接下找到。

相应的客户机

如果安装了NodeJS和npm,请克隆repo,然后在根目录中运行npm install来安装依赖项。

对于需要在根目录中创建一个.env文件的环境变量,该文件包含键助记符和INFURA_KEY,其中包含您的个人数据:

要运行单元测试,请输入:

要部署到Kovan测试网络,请运行

这将部署MBMarketFactory契约。将文件夹abis/over的内容复制到客户机repo到src/abis/。此外,请记下已部署人员的地址MBMarketFactory.sol公司,并更新src/utils中的相关变量/地址.ts(kovan的第6行),也在客户回购中。然后按照该repo的自述文件在本地运行应用程序。

Magic Bet使用工厂合同,工厂合同本身部署市场,以及任何相应的ERC20。上面只部署工厂合同,市场合同由前端部署。

发送到合同的所有Dai都发送到Aave,由此开始累积利息。当用户取款时,利息和本金将从Aave中提取,合同中的资金不会超过单个区块。

该合同完全集成了Uniswap V2,如果用户愿意,可以使用Eth而不是Dai支付。

合同使用realati作为一种预言。对于持续的争端,权力下放的克莱罗斯法院被指定为仲裁员。魔术投注团队没有设定结果的能力。有关oracle如何工作的详细信息,请查看本文🎩 MagicBet-合同

MagicBet是一个建立在以太坊eth之上的无损失投注平台。它允许用户在未来的事件和结果上下注,而不需要冒最初的风险。

所有赌注都会产生利息,直到下注的事件发生为止。利息支付然后在赢家之间分享,所有参与者(赢家和输家)都会拿回他们的股份,这样用户就可以以一种有趣的方式省钱。

用户铸造的ERC20代币相当于Dai赌注,必须在收到他们的赌注(以及赢款,如果有的话)时烧掉。

此项目包含以太坊eth智能合约,客户代码可在以下链接下找到。

相应的客户机

Setup

如果安装了NodeJS和npm,请克隆repo,然后在根目录中运行npm install来安装依赖项。

对于需要在根目录中创建一个.env文件的环境变量,该文件包含键助记符和INFURA_KEY,其中包含您的个人数据:

INFURA_KEY=your_key_4_infura MNEMONIC=the mnemonic phrase for your wallet 

Testing

要运行单元测试,请输入:

npx buidler test

Deploy

要部署到Kovan测试网络,请运行

truffle migrate --reset --network kovan

这将部署MBMarketFactory契约。将文件夹abis/over的内容复制到客户机repo到src/abis/。此外,请记下已部署人员的地址MBMarketFactory.sol公司,并更新src/utils中的相关变量/地址.ts(kovan的第6行),也在客户回购中。然后按照该repo的自述文件在本地运行应用程序。

Behind the scenes

Magic Bet使用工厂合同,工厂合同本身部署市场,以及任何相应的ERC20。上面只部署工厂合同,市场合同由前端部署。

发送到合同的所有Dai都发送到Aave,由此开始累积利息。当用户取款时,利息和本金将从Aave中提取,合同中的资金不会超过单个区块。

该合同完全集成了Uniswap V2,如果用户愿意,可以使用Eth而不是Dai支付。

合同使用realati作为一种预言。对于持续的争端,权力下放的克莱罗斯法院被指定为仲裁员。魔术投注团队没有设定结果的能力。有关oracle如何工作的详细信息,请查看本文🎩 MagicBet-合同

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

www.interchains.cc

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

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

提供最优质的资源集合

立即查看 了解详情