Splitter – 分离器区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,Splitter – 分离器区块链毕设代写 是一篇很好的国外资料

Splitter

Splitter is a smart contract for receiving funds, and split them in proportion among recipients added by the contract owner.

It’s built on top of PaymentSplitter from Openzeppelin. People can deploy their own Splitter contract in order to split payment from payers to a set of payees’ addresses.

For example of some use cases,

  • a hackathon team want to split prizes from sponsors to the team members,
  • or a team registered as a Gitcoin Grant want to split funds from contributors to the team members.

Rules of the Contract

  • Deployer can decide the owner, initial payees, and the shares.
  • Only owner can add payee, and set the shares.
  • Only owner can finalize the state of the contract.
  • When it comes to be finalized, owner cannot add another payee, so that the number of the payees and the allocation are fixed.
  • Only finalized, payees can withdraw their payment.

Tech-stack

  • vite
  • hardhat
  • typescript
  • yarn workspace

Development

In the project root ./splitter

  1. Install workspaces dependencies
yarn 
  1. Compile contracts and typechain
yarn build:contracts 
  1. Run hardhat network on http://localhost:8545 with chainID 31337
yarn start:node 
  1. Run frontend dev
yarn dev 
  1. Deploy default contract to hardhat network
yarn deploy:local 

References

This project is heavily inspired by HackMoney 2021 – Splits, and the following awesome projects.

contracts

  • Splits: https://github.com/wminshew/splits
  • PaymentSplitter: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/finance/PaymentSplitter.sol
  • matching_contracts: https://github.com/gitcoinco/matching_contracts

frontend

react

  • useDapp tutorial-1: https://dev.to/jacobedawson/build-a-web3-dapp-in-react-login-with-metamask-4chp
  • useDapp tutorial-2: https://dev.to/jacobedawson/send-react-web3-dapp-transactions-via-metamask-2b8n
  • useDapp: https://limaois.me/archives/293

vue3

  • vue-tailwind-ethereum-template: https://github.com/chnejohnson/vue-tailwind-ethereum-template
  • vue-composable: https://github.com/pikax/vue-composable/blob/master/packages/vue-composable/src/web/webSocket.ts
  • web3model-vue: https://github.com/SmallRuralDog/web3modal-vue
  • vue3-eth: https://github.com/samatechtw/vue3-eth

metamask

  • docs: https://docs.metamask.io/guide/getting-started.html#basic-considerations
  • json-rpc-api https://metamask.github.io/api-playground/api-documentation/#wallet_addEthereumChain
  • detect-provider: https://github.com/MetaMask/detect-provider/blob/main/src/index.ts

Monorepo Architecture

Yarn workspaces

  • https://classic.yarnpkg.com/en/docs/workspaces/

Add dependencies

  • yarn workspace @splitter/frontend add <package> --dev

Project’s initial set up

  • npx hardhat
  • yarn create vite

拆分器

Splitter是用于接收资金的智能合约,并按合同所有者添加的接收者之间的比例进行拆分

它建立在Openzeppelin的PaymentSplitter之上。人们可以部署自己的拆分器合同,以便将付款从付款人拆分到一组收款人地址

例如,对于一些用例,项目根目录中的

  • 一个hackathon团队想要将赞助者的奖金分配给团队成员,
  • 或者一个注册为Gitcoin赠款的团队想要将捐款人的资金分配给团队成员

合同规则

  • 部署者可以决定所有者、初始收款人和份额
  • 只有所有者可以添加收款人,并设置份额
  • 只有业主才能最终确定合同状态
  • 最终确定时,所有者不能添加其他收款人,因此收款人的数量和分配是固定的
  • 只有最终确定,收款人才能撤回其付款

开发

  • vite
  • 安全帽
  • 纱线工作区
  • 安装工作区依赖项

参考

。/splitter

  1. 编译合同和类型链
yarn 
  1. 运行安全帽网络http://localhost:8545 使用chainID 31337运行前端开发将默认合约部署到安全帽网络拆分:https://github.com/wminshew/splits
yarn build:contracts 
  1. 付款拆分器:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/finance/PaymentSplitter.sol
yarn start:node 
  1. 匹配合同:https://github.com/gitcoinco/matching_contracts
yarn dev 
  1. 使用DAPP教程-1:https://dev.to/jacobedawson/build-a-web3-dapp-in-react-login-with-metamask-4chp
yarn deploy:local 

合同

该项目深受HackMoney 2021-Splits和以下优秀项目的启发

Monorepo架构

  • 使用DAPP教程-2:https://dev.to/jacobedawson/send-react-web3-dapp-transactions-via-metamask-2b8n
  • 使用DAPP:https://limaois.me/archives/293
  • vue tailwind以太坊eth模板:https://github.com/chnejohnson/vue-tailwind-ethereum-template

纱线工作区

项目的初始设置

  • vue可组合:https://github.com/pikax/vue-composable/blob/master/packages/vue-composable/src/web/webSocket.ts
  • Web3模型vue:https://github.com/SmallRuralDog/web3modal-vue
  • vue3 eth:https://github.com/samatechtw/vue3-eth

vue3

  • 文档:https://docs.metamask.io/guide/getting-started.html#basic-注意事项
  • json rpc apihttps://metamask.github.io/api-playground/api-documentation/#wallet_addEthereumChain
  • 检测提供程序:https://github.com/MetaMask/detect-provider/blob/main/src/index.ts
  • vue3-eth: https://github.com/samatechtw/vue3-eth

metamask

  • https://classic.yarnpkg.com/en/docs/workspaces/
  • 纱线工作区@拆分器/前端添加&lt;包装&gt–dev
  • npx安全帽

Monorepo Architecture

Yarn workspaces

  • https://classic.yarnpkg.com/en/docs/workspaces/

Add dependencies

  • yarn workspace @splitter/frontend add <package> --dev

Project’s initial set up

  • npx hardhat
  • yarn create vite

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

www.interchains.cc

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

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

提供最优质的资源集合

立即查看 了解详情