GoodDollar – GoodContracts – 好美元-好合同区块链毕设代写

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

GoodDollar – GoodContracts

GoodDollar - GoodContracts - 好美元-好合同 GoodDollar - GoodContracts - 好美元-好合同 GoodDollar - GoodContracts - 好美元-好合同 GoodDollar - GoodContracts - 好美元-好合同

Contributing

Welcome to the GoodDollar repository!

Everyone is welcome: Developers, designers, and entrepreneurs with a passion for decentralized technologies and a vision to build a new world that has equality, security, inclusivity, and innovation as its cornerstones. Refer to GoodDocs for further information.

Try GoodDollar

Installation

Clone the repository:

git clone https://github.com/GoodDollar/GoodContracts.git

Install packages:

npm install

Usage

To test the library and setup the environment, issue the following command:

  npm run test

Setup GoodDollar

  1. Go to the GoodContracts repository:
cd GoodContracts
  1. Create a .env file:
cp .env.example .env
  1. Fill in the required information. see Configuration for descriptions.

Deploy GoodDollar

The GoodContracts DAO can be deployed in two ways:

full – All contracts are deployed to the network given in .env. This is done by running npm run deploy:full

light – The DAO contracts and GoodDollar is deployed. OneTimePayments, UBI and SignUpBonus are not. This is done by running npm run deploy

Deploy UBI

New UBI schemes are deployed by calling

npm run deploy:ubi

This will deploy a UBI contract with the parameters given in the migration script, propose it as a new scheme vote for it and start the contract if enough votes are given.

Deploy SignUpBonus

New SignUpBonus schemes are deployed by calling

npm run deploy:signup

This will deploy a SignUpBonus contract with the parameters given in the migration script, propose it as a new scheme vote for it and start the contract if enough votes are given.

Deploy OneTimePayment

New OneTimePayments schemes are deployed by calling

npm run deploy:otp

This will deploy a OneTimePayment contract with the parameters given in the migration script, propose it as a new scheme vote for it and start the contract if enough votes are given.

Prerequisites

You need to have node installed. This repository has only been tested on UNIX-derived systems.

Files

Path Description
contracts/ All the solidity files making up the implementation
contracts/token Contains the GoodDollar implementation
contracts/token/ERC677 ERC677 implementation
contracts/identity Defines the identity implementation, i.e. adding claimers and blacklisting
contracts/dao Contains the daocreator for creating DAOs
contracts/dao/schemes Contains different schemes that can be deployed, registered and used within the DAO
contracts/mocks Contracts used specifically for testing purposes
test/ Contains testing code
scripts/  Specific scripts for testing and coverage

Learn about GoodDollar

The GoodDollar mission is reducing wealth inquality by building a new, global, open-source cryptocurrency for distributing money according to the principles of universal basic income (UBI).

To learn more about the reasoning behind the GoodDollar Experiment, please read the Position Paper.

This implementation of the GoodDollar contract system contains forked and modified from the DAOstack repo. We recommend anyone interested in learning about DAOs to [read and contribute] https://github.com/daostack

In this document, we present the on going development efforts and specification of the extended design of the GoodDollar contract system. In section one, we introduce the key concepts of the contract system. In section two, we introduce the individual contracts available in this repo.

This text introduces the core components of the GoodDollar contract system and is intended as a brief overview of the current status of development. This specification is subject to ongoing development and frequent review. This text may not reflect the most recent commit.

GoodDollar Economic Model and Contracts

Staking Model

GoodDollar Design Overview

In the Table presented below, we provide an overview of the extended design of the GoodDollar contract system suggested for this specification.

GoodDollar - GoodContracts - 好美元-好合同

Figure 1: Design overview of the GoodContracts system

GoodDollar Contract System: The Key Concepts

The GoodDollar contract system is an implementation of a decentralized autonomous organization. The design presented in this document is an iterative policy framework through which users can engage in the collective decision making on the allocation and inflation schedule of a new asset-class: The GoodDollar.

Users suggest, advocate and vote for policy proposals in the form of ‘schemes’. A scheme is a user-defined script, containing the logic by which the distribution of community funds is executed at specified intervals.

Once implemented, a scheme will run for a given period of time and subsequently deprecate, at which point the community will vote on either extending or replacing the extant scheme.

Voting power is defined by ‘reputation points’, a value assigned to all registered addresses. Reputation points can be distributed by any arbitrary logic and perform any arbitrary decision making function in the system. In this implementation, reputation points denote a weighted distribution in which one reputation point equals one vote in a binary choice evaluated by the absolute majority criterion.

The voting logic itself is also implemented as a scheme and is, just as the distribution policy, subject to change by a absolute majority voting.

This concept facilitates the abstract notion of decentralized decision-making in distributed systems of autonomous agents, as the contract system assimilates the political decision-making process through which fiscal policy is implemented in conventional parlimentary systems. Nevertheless, here all participants can attain voting power by virtue of their participation and engagement with the system.

In the following months, we will present more cohesive work on the topic of voting power and decentralized decision-making in decentralized systems. Please stay in touch by following this repo or keep an eye out on social media.

The contract system for the current release, comprises four main components:

Implementation of a Decentralized Autonomous UBI system (The DAU)

The DAU is a decentralized decision-making and resource distribution mechanism. It contains four elements:

  • Schemes – A “scheme” is a ‘wrapper’ enacting a given policy or functionality in the GoodDollar contract system. Schemes are deployed by users and elected by the DAU contract through ‘reputation voting’ (see below). The UBI distribution policy, the one-time payment link policy, the sign-up bonus policy, and the identity contract are all implemented as ‘schemes’ and can be reiterated and redeployed by the GoodDollar community.

  • Reputation points – Reputation points are awarded to user accounts by the DAU. The reputation distribution function will be based on contributions to the system, as defined by the GoodDollar community. Reputation is non-transferable and (re)distributed by the DAU.

  • Voting Mechanism – Schemes are approved or rejected through voting. Rules can be implemented for any arbritary voting process and logic. In this initial implementation, voting follows the standard absolute majority criterion. In this implementation, a single reputation point will denote a single vote in the scheme selection process.

  • Global Constraints – Global constraints are limitations the DAUs actions. When executing a scheme, the controller component checks the constraints to see if a given action violates them, and blocks the execution if it does.

Representation of Value with an ERC20 Token (The GoodDollar)

The GoodDollar is a mintable, burnable and ERC20 compatible token. The GoodDollar token can collect an adjustable fee stored in a reserve, whenever a transaction is made.

Achieving Tranaction speed with a Bridge Contract and Sidechain

The bridge contract is an interoperability protocol that allows users to easily and safely transfer digital assets between two blockchains. Similar to an atomic swap operation, assets are locked in one network while representative assets are minted in the other one, and when the process is reversed the representative assets are burned and the locked assets released. The GoodDollar system is currently implemented on a sidechain connected through the Bridge Contract. For this implementation, we deploy on the fuse network: https://github.com/ColuLocalNetwork/fuse-network

Contract Overview

In the Table presented below, we provide a simple overview of the GoodDollar contract and scheme taxonomy. Only the most fundemental schemes are included in the list below.

name Description
GoodDollar ERC20 Token that collects fees in every transfer. Native token of the system
DaoCreator Creates a single GoodDollar organization with an array of founders able to vote for schemes.
Controller The central entity of the DAO which connects the Avatar and gives permission to the other contracts.
Avatar A contract that receives the fee, stores it and communicates with the outer world
UBI The Universal Basic Income calculating and processing contract scheme.
SignUpBonus The sign-up bonus handling contract.
OneTimePayments The one-time payment contract.
Identity The contract defines who is eligible to claim the tokens and counts the total number of people who signed up for it.

GoodDollar

The GoodDollar token is a mintable, burnable and ERC20 compatible token. In this implementation, the token collects an adjustable fee.

Below we list the three main functions, adopted from the standard contract:

name Description Working Priciple
transfer(to, value) / transferFrom(from, to, value) Gives the system the ability to collect fees. Whenever transfer or transferFrom is called with a given value, processFees is called with said value, transferring the transactional fees (set by the DAO at any given time, by a specific scheme) to the feeRecipient and returning the new value to be transferred along.
approve(spender, value) Gives a delegate the right to spend a certain amount of tokens of a delegator. The delegators retain the ownership of the tokens until they are spent. no peculiarities
balanceOf(user) It allows the system to know the G$ balance of a specific address. no peculiarities

Below, we display the GoodDollar transfer function sequence diagram, highlighting the details of the process.

GoodDollar - GoodContracts - 好美元-好合同

Figure 2: Transfer function. Checks identity, then sends fees to avatar, which returns the new transfer value and sends it to the receiver.

DAUCreator

The DAUCreator contract is responsible for creating the DAU in a single transaction. When creating a DAU, a Token (The GoodDollar token) and reputation are created, which are then used to create the avatar. The founders specified in the creation are then granted their respective tokens and reputation. The controller is then created and given ownership of the GoodDollar, Reputation and Avatar. The caller of the dao creation transaction is then allowed to register an array of initial schemes.

Controller

The Controller is the ‘owner’ of the DAO. It gives permission to other schemes, enforces adherence to global constraints, regulate the reputation points and most importantly it connects to the Avatar.

Avatar

The Avatar is the outer facing part of the DAO system, which interacts with the other DAOs and contracts. The three main functions of the Avatar are to:

  • Communicate with other contracts
  • Receive the transaction fees
  • Store the fees and also other tokens (i.e., Ether)

Schemes

A UBI scheme can be created by anyone and submitted to the GoodDollar Community. A UBI scheme is proposed and voted upon by users. Once a UBI scheme is implemented, the Controller transfers the alotted amounts from the reserves.

When the UBI scheme is created, the author defines start and end periods. A bool, isActive, is set to false, making the policy ‘dormant’ until start() is called. Once start() is called the UBI is active and the claiming process begins.

The Reserve (Avatar) sends all its funds to the UBI contract, and the GoodDollar to mint, indicated in the constructor, is minted to and sent to the contract.

GoodDollar - GoodContracts - 好美元-好合同

Figure 3: The three states the UBI contract moves through

Then, the distribution ratio is calculated and isActive is set to true, allowing users registered as claimers (before the start period) to claim UBI. After a successfull claim is registered, the users claimin status is updated in order to prevent multiple claims from the same address.

GoodDollar - GoodContracts - 好美元-好合同

Figure 4: UBI claiming sequence diagram

Finally, the end() function is called, terminating the contract. This can only be done after the period has been exceeded. A deprecated scheme transfers all remaining funds back to the reserve.

Supporting Contracts

A number of contracts are implemented to support the launch of the GoodDollar system. These contracts are implemented as ‘schemes’ and are subject to reputation voting by the community.

Sign-up bonus

The sign-up bonus scheme allows administrators to award tokens up to a given maximum to users for inviting others.

OneTimePayments

The OneTimePayments scheme is able to receive funds and keep them stored under a hashed code, allowing users to send funds to unregistered users that can be claimed once they have been registered.

Identity

The Identity scheme manages the list of verified user addresses and blacklisted addresses.

Community

Below you can find a comprehensive list of useful links.

  • Check out our community website
  • Check out our Blog
  • Join the Gooddollar Alpha by signing up here and validating your identity
  • Contribute to the code on our GitHub
  • Join our community forum here
  • Become an ambassador here
  • Request a sponsorship here
  • Follow us on Twitter
  • Join our Telegram group
  • Like and subscribe on Facebook
  • Check out our YouTube video channel
  • Subscribe to our Medium blog
  • View our terms and conditions

GoodDollar – GoodContracts

<GoodDollar - GoodContracts><GoodDollar - GoodContracts><GoodDollar - GoodContracts><GoodDollar - GoodContracts><GoodDollar - GoodContracts>GoodDollar - GoodContracts - 好美元-好合同

欢迎来到GoodDollar存储库!

每个人都是受欢迎的:对分散式技术充满热情的开发人员、设计师和企业家,他们希望建立一个以平等、安全、包容和创新为基石的新世界。有关更多信息,请参阅GoodDocs。

克隆存储库:

安装软件包:

若要测试库并设置环境,请发出以下命令:

可以通过两种方式部署GoodContracts DAO:

full-所有合约都部署到.env中给定的网络。这是通过运行npm run来完成的部署:完全

轻-DAO收缩,GoodDollar部署完毕。一次性付款,UBI和SignUpBonus则不是。这是通过运行npm run deploy来实现的

通过调用来部署新的UBI方案,这将使用迁移脚本中给定的参数部署UBI契约,将其作为新方案进行投票,并在获得足够票数的情况下启动合同。

通过调用来部署新的SignUpBonus方案,这将使用迁移脚本中给定的参数部署SignUpBonus契约,将其作为新方案进行投票,并在获得足够票数的情况下启动契约。

通过调用来部署新的OneTimePayments方案,这将使用迁移脚本中给定的参数部署一个OneTimePayment合同,将其作为新方案进行投票,并在获得足够票数的情况下启动合同。

您需要安装节点。此存储库仅在UNIX派生系统上进行过测试。

GoodDollar的使命是通过建立一种新的、全球性的、开源的加密货币来根据普遍基本收入(UBI)的原则分配货币,从而在质量上减少财富。

要了解更多关于GoodDollar实验背后的推理,请阅读立场文件。

GoodDollar合同系统的这个实现包含从DAOstack回购协议派生和修改的内容。我们建议有兴趣学习DAOs的人[阅读并投稿]https://github.com/daostack

在本文中,我们介绍了GoodDollar合同系统扩展设计的持续开发工作和规范。第一节介绍了合同制度的基本概念。在第二节中,我们介绍了本次回购中可用的个别合同。

本文介绍了GoodDollar合同体系的核心组成部分,并对其发展现状作了简要概述。本规范正在进行开发和经常审查。此文本可能不反映最近的提交。

立桩模型

在下表中,我们概述了本规范建议的GoodDollar合同系统的扩展设计。

。本文中介绍的设计是一个迭代的策略框架,通过该框架,用户可以参与对新资产类别GoodDollar的分配和通胀时间表的集体决策。

用户以“方案”的形式对政策建议进行建议、倡导和投票。方案是一个用户定义的脚本,包含按指定时间间隔执行社区资金分配的逻辑。

一旦实施,一个计划将运行一段给定的时间,随后将被否决,届时社区将投票决定是否延长或替换现有的计划。

投票权由“信誉点”定义,信誉点是分配给所有注册地址的值。在系统中,信誉点可以按任意逻辑分布,执行任意的决策功能。在这个实现中,信誉点表示一个加权分布,其中一个信誉点等于一个投票权,在一个二进制选择中,绝对多数准则评估。

投票逻辑本身也是作为一个方案来实现的,就像分配政策一样,可以通过绝对多数投票来改变。

这一概念促进了自治主体分布式系统中分散决策的抽象概念,因为契约系统吸收了传统辅助系统中实施财政政策的政治决策过程。然而,在这里,所有的参与者都可以通过参与和参与制度而获得投票权。在接下来的几个月里,我们将介绍分散的投票系统和更具凝聚力的投票系统。请关注此回购或关注社交媒体,保持联系。

当前版本的合同系统包括四个主要组件:

DAU是一个分散的决策和资源分配机制。它包含四个元素:

方案-“方案”是在GoodDollar合同系统中执行给定策略或功能的“包装器”。方案由用户部署,并由DAU合同通过“信誉投票”进行选择(见下文)。UBI分销政策、一次性支付链接政策、签约奖金政策和身份合同均作为“计划”实施,并可由GoodDollar社区重申和重新部署。

信誉积分-信誉积分由DAU授予用户帐户。声誉分配功能将根据GoodDollar社区的定义,基于对系统的贡献。声誉是不可转让和(重新)分配的DAU。

投票机制-通过投票批准或否决方案。规则可用于任意表决过程和逻辑。在最初的实施中,投票遵循标准的绝对多数标准。在这个实现中,单个信誉点表示方案选择过程中的一次投票。

全局约束-全局约束是DAUs操作的限制。在执行方案时,控制器组件检查约束以查看给定操作是否违反约束,如果违反,则阻止执行。

GoodDollar是一种可铸造、可燃烧且与ERC20兼容的代币。无论何时进行交易,GoodDollar代币都可以收取存储在储备金中的可调整费用。

网桥合同是一种互操作性协议,允许用户在两个区块链blockchain之间轻松、安全地传输数字资产。与原子交换操作类似,资产被锁定在一个网络中,而代表性资产在另一个网络中铸造,当该过程被逆转时,代表性资产被烧毁,锁定的资产被释放。GoodDollar系统目前在通过桥接合同连接的侧链上实现。为此,我们在fuse网络上部署:https://github.com/ColuLocalNetwork/fuse-network

在下表中,我们提供了GoodDollar合同和方案分类法的简单概述。下表仅列出了大部分的基金计划。

GoodDollar代币是一种可铸造、可燃烧且与ERC20兼容的代币。在这个实现中,代币收取可调整的费用。

下面我们列出了标准合同中采用的三个主要功能:

下面,我们展示了GoodDollar转移函数序列图,突出了流程的细节。

GoodDollar - GoodContracts - 好美元-好合同

图2:传递函数。检查身份,然后向化身发送费用,化身返回新的传输值并将其发送给接收方。

DAUCreator合同负责在单个事务中创建DAU。当创建一个DAU时,会创建一个令牌(GoodDollar令牌)和声誉,然后使用它们来创建化身。创建中指定的创始人将被授予各自的代币和声誉。然后创建控制器并赋予GoodDollar、声誉和头像的所有权。然后允许dao创建事务的调用方注册初始方案数组。

控制器是DAO的“所有者”。它允许其他方案,强制遵守全局约束,调节声誉点,最重要的是它连接到化身。

化身是DAO系统的面向外部的部分,它与其他DAO和契约进行交互。化身的三个主要功能是:

任何人都可以创建UBI方案并提交给GoodDollar社区。提出了一种UBI方案,并由用户投票表决。一旦UBI方案实施,控制者从储备中转移分配的金额。

创建UBI方案时,作者定义了开始和结束期间。bool isActive设置为false,使策略在调用start()之前处于休眠状态。一旦调用start(),UBI就处于活动状态,并开始声明过程。

储备(Avatar)将其所有资金发送到UBI合同,而GoodDollar to mint在构造器中指明,则被铸造到并发送到合同中。

。注册成功的索赔后,更新用户索赔状态,以防止来自同一地址的多个索赔。

<GoodDollar - GoodContracts>

图4:UBI声明序列图

最后,调用end()函数,终止合同。这只能在超过期限后进行。不推荐的方案将所有剩余资金转移回

Contributing

欢迎来到GoodDollar存储库!

每个人都是受欢迎的:对分散式技术充满热情的开发人员、设计师和企业家,他们希望建立一个以平等、安全、包容和创新为基石的新世界。有关更多信息,请参阅GoodDocs。

Try GoodDollar

Installation

克隆存储库:

git clone https://github.com/GoodDollar/GoodContracts.git

安装软件包:

npm install

Usage

若要测试库并设置环境,请发出以下命令:

  npm run test

Setup GoodDollar

  1. Go to the GoodContracts repository:
cd GoodContracts
  1. Create a .env file:
cp .env.example .env
  1. Fill in the required information. see Configuration for descriptions.

Deploy GoodDollar

可以通过两种方式部署GoodContracts DAO:

full-所有合约都部署到.env中给定的网络。这是通过运行npm run来完成的部署:完全

轻-DAO收缩,GoodDollar部署完毕。一次性付款,UBI和SignUpBonus则不是。这是通过运行npm run deploy来实现的

Deploy UBI

通过调用来部署新的UBI方案,这将使用迁移脚本中给定的参数部署UBI契约,将其作为新方案进行投票,并在获得足够票数的情况下启动合同。

npm run deploy:ubi

通过调用来部署新的SignUpBonus方案,这将使用迁移脚本中给定的参数部署SignUpBonus契约,将其作为新方案进行投票,并在获得足够票数的情况下启动契约。

Deploy SignUpBonus

通过调用来部署新的OneTimePayments方案,这将使用迁移脚本中给定的参数部署一个OneTimePayment合同,将其作为新方案进行投票,并在获得足够票数的情况下启动合同。

npm run deploy:signup

您需要安装节点。此存储库仅在UNIX派生系统上进行过测试。

Deploy OneTimePayment

GoodDollar的使命是通过建立一种新的、全球性的、开源的加密货币来根据普遍基本收入(UBI)的原则分配货币,从而在质量上减少财富。

npm run deploy:otp

要了解更多关于GoodDollar实验背后的推理,请阅读立场文件。

Prerequisites

GoodDollar合同系统的这个实现包含从DAOstack回购协议派生和修改的内容。我们建议有兴趣学习DAOs的人[阅读并投稿]https://github.com/daostack

Files

Path Description
contracts/ All the solidity files making up the implementation
contracts/token Contains the GoodDollar implementation
contracts/token/ERC677 ERC677 implementation
contracts/identity Defines the identity implementation, i.e. adding claimers and blacklisting
contracts/dao Contains the daocreator for creating DAOs
contracts/dao/schemes Contains different schemes that can be deployed, registered and used within the DAO
contracts/mocks Contracts used specifically for testing purposes
test/ Contains testing code
scripts/  Specific scripts for testing and coverage

Learn about GoodDollar

在本文中,我们介绍了GoodDollar合同系统扩展设计的持续开发工作和规范。第一节介绍了合同制度的基本概念。在第二节中,我们介绍了本次回购中可用的个别合同。

本文介绍了GoodDollar合同体系的核心组成部分,并对其发展现状作了简要概述。本规范正在进行开发和经常审查。此文本可能不反映最近的提交。

立桩模型

在下表中,我们概述了本规范建议的GoodDollar合同系统的扩展设计。

This text introduces the core components of the GoodDollar contract system and is intended as a brief overview of the current status of development. This specification is subject to ongoing development and frequent review. This text may not reflect the most recent commit.

GoodDollar Economic Model and Contracts

。本文中介绍的设计是一个迭代的策略框架,通过该框架,用户可以参与对新资产类别GoodDollar的分配和通胀时间表的集体决策。

GoodDollar Design Overview

用户以“方案”的形式对政策建议进行建议、倡导和投票。方案是一个用户定义的脚本,包含按指定时间间隔执行社区资金分配的逻辑。

一旦实施,一个计划将运行一段给定的时间,随后将被否决,届时社区将投票决定是否延长或替换现有的计划。

投票权由“信誉点”定义,信誉点是分配给所有注册地址的值。在系统中,信誉点可以按任意逻辑分布,执行任意的决策功能。在这个实现中,信誉点表示一个加权分布,其中一个信誉点等于一个投票权,在一个二进制选择中,绝对多数准则评估。

GoodDollar Contract System: The Key Concepts

投票逻辑本身也是作为一个方案来实现的,就像分配政策一样,可以通过绝对多数投票来改变。

这一概念促进了自治主体分布式系统中分散决策的抽象概念,因为契约系统吸收了传统辅助系统中实施财政政策的政治决策过程。然而,在这里,所有的参与者都可以通过参与和参与制度而获得投票权。在接下来的几个月里,我们将介绍分散的投票系统和更具凝聚力的投票系统。请关注此回购或关注社交媒体,保持联系。

当前版本的合同系统包括四个主要组件:

DAU是一个分散的决策和资源分配机制。它包含四个元素:

方案-“方案”是在GoodDollar合同系统中执行给定策略或功能的“包装器”。方案由用户部署,并由DAU合同通过“信誉投票”进行选择(见下文)。UBI分销政策、一次性支付链接政策、签约奖金政策和身份合同均作为“计划”实施,并可由GoodDollar社区重申和重新部署。

信誉积分-信誉积分由DAU授予用户帐户。声誉分配功能将根据GoodDollar社区的定义,基于对系统的贡献。声誉是不可转让和(重新)分配的DAU。

投票机制-通过投票批准或否决方案。规则可用于任意表决过程和逻辑。在最初的实施中,投票遵循标准的绝对多数标准。在这个实现中,单个信誉点表示方案选择过程中的一次投票。

全局约束-全局约束是DAUs操作的限制。在执行方案时,控制器组件检查约束以查看给定操作是否违反约束,如果违反,则阻止执行。

Implementation of a Decentralized Autonomous UBI system (The DAU)

GoodDollar是一种可铸造、可燃烧且与ERC20兼容的代币。无论何时进行交易,GoodDollar代币都可以收取存储在储备金中的可调整费用。

  • 网桥合同是一种互操作性协议,允许用户在两个区块链blockchain之间轻松、安全地传输数字资产。与原子交换操作类似,资产被锁定在一个网络中,而代表性资产在另一个网络中铸造,当该过程被逆转时,代表性资产被烧毁,锁定的资产被释放。GoodDollar系统目前在通过桥接合同连接的侧链上实现。为此,我们在fuse网络上部署:https://github.com/ColuLocalNetwork/fuse-network

  • 在下表中,我们提供了GoodDollar合同和方案分类法的简单概述。下表仅列出了大部分的基金计划。

  • GoodDollar代币是一种可铸造、可燃烧且与ERC20兼容的代币。在这个实现中,代币收取可调整的费用。

  • 下面我们列出了标准合同中采用的三个主要功能:

Representation of Value with an ERC20 Token (The GoodDollar)

下面,我们展示了GoodDollar转移函数序列图,突出了流程的细节。

Achieving Tranaction speed with a Bridge Contract and Sidechain

GoodDollar - GoodContracts - 好美元-好合同

Contract Overview

图2:传递函数。检查身份,然后向化身发送费用,化身返回新的传输值并将其发送给接收方。

name Description
GoodDollar ERC20 Token that collects fees in every transfer. Native token of the system
DaoCreator Creates a single GoodDollar organization with an array of founders able to vote for schemes.
Controller The central entity of the DAO which connects the Avatar and gives permission to the other contracts.
Avatar A contract that receives the fee, stores it and communicates with the outer world
UBI The Universal Basic Income calculating and processing contract scheme.
SignUpBonus The sign-up bonus handling contract.
OneTimePayments The one-time payment contract.
Identity The contract defines who is eligible to claim the tokens and counts the total number of people who signed up for it.

GoodDollar

DAUCreator合同负责在单个事务中创建DAU。当创建一个DAU时,会创建一个令牌(GoodDollar令牌)和声誉,然后使用它们来创建化身。创建中指定的创始人将被授予各自的代币和声誉。然后创建控制器并赋予GoodDollar、声誉和头像的所有权。然后允许dao创建事务的调用方注册初始方案数组。

控制器是DAO的“所有者”。它允许其他方案,强制遵守全局约束,调节声誉点,最重要的是它连接到化身。

name Description Working Priciple
transfer(to, value) / transferFrom(from, to, value) Gives the system the ability to collect fees. Whenever transfer or transferFrom is called with a given value, processFees is called with said value, transferring the transactional fees (set by the DAO at any given time, by a specific scheme) to the feeRecipient and returning the new value to be transferred along.
approve(spender, value) Gives a delegate the right to spend a certain amount of tokens of a delegator. The delegators retain the ownership of the tokens until they are spent. no peculiarities
balanceOf(user) It allows the system to know the G$ balance of a specific address. no peculiarities

化身是DAO系统的面向外部的部分,它与其他DAO和契约进行交互。化身的三个主要功能是:

任何人都可以创建UBI方案并提交给GoodDollar社区。提出了一种UBI方案,并由用户投票表决。一旦UBI方案实施,控制者从储备中转移分配的金额。

创建UBI方案时,作者定义了开始和结束期间。bool isActive设置为false,使策略在调用start()之前处于休眠状态。一旦调用start(),UBI就处于活动状态,并开始声明过程。

DAUCreator

储备(Avatar)将其所有资金发送到UBI合同,而GoodDollar to mint在构造器中指明,则被铸造到并发送到合同中。

Controller

The Controller is the ‘owner’ of the DAO. It gives permission to other schemes, enforces adherence to global constraints, regulate the reputation points and most importantly it connects to the Avatar.

Avatar

<GoodDollar - GoodContracts>

  • Communicate with other contracts
  • Receive the transaction fees
  • Store the fees and also other tokens (i.e., Ether)

Schemes

图4:UBI声明序列图

最后,调用end()函数,终止合同。这只能在超过期限后进行。不推荐的方案将所有剩余资金转移回

The Reserve (Avatar) sends all its funds to the UBI contract, and the GoodDollar to mint, indicated in the constructor, is minted to and sent to the contract.

GoodDollar - GoodContracts - 好美元-好合同

Figure 3: The three states the UBI contract moves through

Then, the distribution ratio is calculated and isActive is set to true, allowing users registered as claimers (before the start period) to claim UBI. After a successfull claim is registered, the users claimin status is updated in order to prevent multiple claims from the same address.

GoodDollar - GoodContracts - 好美元-好合同

Figure 4: UBI claiming sequence diagram

Finally, the end() function is called, terminating the contract. This can only be done after the period has been exceeded. A deprecated scheme transfers all remaining funds back to the reserve.

Supporting Contracts

A number of contracts are implemented to support the launch of the GoodDollar system. These contracts are implemented as ‘schemes’ and are subject to reputation voting by the community.

Sign-up bonus

The sign-up bonus scheme allows administrators to award tokens up to a given maximum to users for inviting others.

OneTimePayments

The OneTimePayments scheme is able to receive funds and keep them stored under a hashed code, allowing users to send funds to unregistered users that can be claimed once they have been registered.

Identity

The Identity scheme manages the list of verified user addresses and blacklisted addresses.

Community

Below you can find a comprehensive list of useful links.

  • Check out our community website
  • Check out our Blog
  • Join the Gooddollar Alpha by signing up here and validating your identity
  • Contribute to the code on our GitHub
  • Join our community forum here
  • Become an ambassador here
  • Request a sponsorship here
  • Follow us on Twitter
  • Join our Telegram group
  • Like and subscribe on Facebook
  • Check out our YouTube video channel
  • Subscribe to our Medium blog
  • View our terms and conditions

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

www.interchains.cc

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

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

提供最优质的资源集合

立即查看 了解详情