Introduction to KP2R NETWORK – KP2R网络简介区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,Introduction to KP2R NETWORK – KP2R网络简介区块链毕设代写 是一篇很好的国外资料

Introduction to KP2R NETWORK

Keep2r Network is a decentralized keeper network for projects that need external devops and for external teams to find keeper jobs

Keepers

A Keeper is the term used to refer to an external person and/or team that executes a job. This can be as simplistic as calling a transaction, or as complex as requiring extensive off-chain logic. The scope of Keep2r network is not to manage these jobs themselves, but to allow contracts to register as jobs for keepers, and keepers to register themselves as available to perform jobs. It is up to the individual keeper to set up their devops and infrastructure and create their own rules based on what transactions they deem profitable.

Jobs

A Job is the term used to refer to a smart contract that wishes an external entity to perform an action. They would like the action to be performed in “good will” and not have a malicious result. For this reason they register as a job, and keepers can then execute on their contract.

Becoming a Keeper

To join as a Keeper you call bond(uint) on the Keep2r contract. You do not need to have KPR tokens to join as a Keeper, so you can join with bond(0). There is a 3 day bonding delay before you can activate as a Keeper. Once the 3 days have passed, you can call activate(). Once activated you lastJob timestamp will be set to the current block timestamp.

Registering a Job

A job can be any system that requires external execution, the scope of Keep2r is not to define or restrict the action taken, but to create an incentive mechanism for all parties involved. There are two cores ways to create a Job;

Registering a Job via Governance

If you prefer, you can register as a job by simply submitting a proposal via Governance, to include the contract as a job. If governance approves, no further steps are required.

Registering a Job via Contract Interface

You can register as a job by calling addLiquidityToJob(address,uint) on the Keep2r contract. You must not have any current active jobs associated with this account. Calling addLiquidityToJob(address,uint) will create a pending Governance vote for the job specified by address in the function arguments. You are limited to submit a new job request via this address every 14 days.

Job Interface

Some contracts require external event execution, an example for this is the harvest() function in the yearn ecosystem, or the update(address,address) function in the uniquote ecosystem. These normally require a restricted access control list, however these can be difficult for fully decentralized projects to manage, as they lack devops infrastructure.

These interfaces can be broken down into two types, no risk delta (something like update(address,address) in uniquote, which needs to be executed, but not risk to execution), and harvest() in yearn, which can be exploited by malicious actors by front-running deposits.

For no, or low risk executions, you can simply call Keep2r.isKeeper(msg.sender) which will let you know if the given actor is a keeper in the network.

For high, sensitive, or critical risk executions, you can specify a minimum bond, minimum jobs completed, and minimum Keeper age required to execute this function. Based on these 3 limits you can define your own trust ratio on these keepers.

So a function definition would look as follows;

function execute() external {   require(Keep2r.isKeeper(msg.sender), "Keep2r not allowed"); } 

At the end of the call, you simply need to call workReceipt(address,uint) to finalize the execution for the keeper network. In the call you specify the keeper being rewarded, and the amount of KPR you would like to award them with. This is variable based on what you deem is a fair reward for the work executed.

Example Keep2rJob

interface UniOracleFactory {     function update(address tokenA, address tokenB) external; }  interface Keep2r {     function isKeeper(address) external view returns (bool);     function workReceipt(address keeper, uint amount) external; }  contract Keep2rJob {     UniOracleFactory constant JOB = UniOracleFactory(XXXXXX);     Keep2r constant KPR = Keep2r(XXXXXX);      function update(address tokenA, address tokenB) external {         require(KPR.isKeeper(msg.sender), "Keep2rJob::update: not a valid keeper");         JOB.update(tokenA, tokenB);         KPR.workReceipt(msg.sender, 1e18);     } } 

Job Credits

As mentioned in Job Interface, a job has a set amount of credits that they can award keepers with. To receive credits you do not need to purchase KPR tokens, instead you need to provide KPR-WETH liquidity in Uniswap. This will give you an amount of credits equal to the amount of KPR tokens in the liquidity you provide.

You can remove your liquidity at any time, so you do not have to keep buying new credits. Your liquidity provided is never reduced and as such you can remove it whenever you no longer would like a job to be executed.

To add credits, you simply need to have KPR-WETH LP tokens, you then call addLiquidityToJob(address,uint) specifying the job in the address and the amount in the uint. This will then transfer your LP tokens to the contract and keep them in escrow. You can remove your liquidity at any time by calling unbondLiquidityFromJob(), this will allow you to remove the liquidity after 14 days by calling removeLiquidityFromJob()

Github

Keep2r

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


KP2R网络简介基本Cookie

始终处于活动状态
分析cookies

Keep2r网络是一个分散的管理者网络,用于需要外部开发的项目和外部团队寻找管理者工作

始终处于活动状态

管理者是指执行工作的外部人员和/或团队。这可以像调用事务一样简单,也可以像需要广泛的链外逻辑那样复杂。Keep2r网络的范围不是管理这些工作本身,而是允许合同注册为保管人的工作,并且保管人将自己注册为可以执行工作。由个人管理者来建立他们的devops和基础设施,并根据他们认为有利可图的交易创建自己的规则。

分析cookies

作业是指希望外部实体执行操作的智能合约。他们希望在“善意”的情况下采取行动,而不是恶意的结果。因此,他们登记为一份工作,然后管理员可以执行他们的合同。

Becoming a Keeper

作为一名门将加入,你称之为债券(uint)的Keep2r合同。您不需要有KPR令牌作为Keeper加入,所以可以使用bond(0)加入。在你成为一个守护者之前,有3天的结合延迟。三天后,您就可以调用activate()。一旦激活,您的lastJob时间戳将设置为当前块时间戳。

Registering a Job

一项工作可以是任何需要外部执行的系统,Keep2r的范围不是定义或限制所采取的行动,而是为所有相关方创造一种激励机制。创建作业有两种核心方法;

Registering a Job via Governance

如果您愿意,您可以通过治理简单地提交一个建议,将合同作为作业来注册为作业。如果治理部门批准,则不需要进一步的步骤。

Registering a Job via Contract Interface

您可以通过调用Keep2r合同上的addliquitytojob(address,uint)注册为作业。您不能有任何当前活动的作业与此帐户关联。调用addLiquidityToJob(address,uint)将为函数参数中address指定的作业创建挂起的管理投票。您只能通过此地址每14天提交一份新的工作申请。

Job Interface

有些合同需要外部事件执行,例如,eREAR生态系统中的harvest()函数,或者uniquote生态系统中的update(address,address)函数。这些通常需要一个受限的访问控制列表,但是由于缺少devops基础设施,完全分散的项目很难管理这些列表。

这些接口可以分为两种类型,无风险增量(类似于uniquote中的update(address,address),需要执行,但不存在执行风险)和earren中的harvest(),恶意参与者可以通过前置存款来利用它。

对于不执行或低风险执行,只需调用Keep2r.isKeeper(发件人.msg)这会让你知道给定的演员是否是网络的守护者。

对于高风险、敏感风险或关键风险的执行,您可以指定执行此功能所需的最低保证金、完成的最小作业数和最小保管员年龄。基于这三个限制,你可以定义你自己对这些保管人的信任比率。

因此函数定义如下所示;

function execute() external {   require(Keep2r.isKeeper(msg.sender), "Keep2r not allowed"); } 

在调用结束时,只需调用workReceipt(address,uint)即可完成keeper网络的执行。在呼叫中,你指定了被奖励的守门员,以及你想要奖励他们的KPR数量。这是一个变量,基于你认为是一个公平的报酬所执行的工作。

例如Keep2rJob

interface UniOracleFactory {     function update(address tokenA, address tokenB) external; }  interface Keep2r {     function isKeeper(address) external view returns (bool);     function workReceipt(address keeper, uint amount) external; }  contract Keep2rJob {     UniOracleFactory constant JOB = UniOracleFactory(XXXXXX);     Keep2r constant KPR = Keep2r(XXXXXX);      function update(address tokenA, address tokenB) external {         require(KPR.isKeeper(msg.sender), "Keep2rJob::update: not a valid keeper");         JOB.update(tokenA, tokenB);         KPR.workReceipt(msg.sender, 1e18);     } } 

Job Credits

如作业界面中所述,作业具有一定数量的学分,可以授予管理员。要获得信用,您不需要购买KPR代币,而是需要在Uniswap中提供KPR-WETH流动性。这将为您提供的信用额度等于您提供的流动性中的KPR代币金额。

您可以随时取出流动资金,因此您不必继续购买新的信贷。你所提供的流动资金永远不会减少,因此,你可以在你不想再执行一项工作的时候将其移除。

要添加积分,只需使用KPR-WETH LP代币,然后调用addLiquidityToJob(address,uint),指定地址中的作业和uint中的金额。然后将代币转移到你的代币代管中。您可以通过调用UnboundLiquidityFromJob()随时移除流动性,这将允许您在14天后通过调用removeLiquidityFromJob()移除流动性。

Github

Keep2r

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

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

www.interchains.cc

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

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

提供最优质的资源集合

立即查看 了解详情