(推文)Berachef合约简介 (Thread-Berachef contract walk-through)

1/ On Berachain, validators must direct their block-building rewards to dapps via Rewards Vaults. Validators choose how to distribute their rewards, configuring which vaults and the weights via their "cutting board" Let's walk through how this works at the smart contract level !

在 Berachain 上,验证者必须通过奖励金库将其区块构建奖励直接发送给 dapp。验证者选择如何分配他们的奖励,通过他们的“案板”配置哪些金库和权重。让我们来看看这在智能合约层面是如何工作的!

2/ Each validator has a cutting board, and the Berachef contract manages all of the cutting boards. Specifically, it manages the cutting boards, and what we call the "friends of the chef", the governance-approved, whitelisted vaults where validators can direct emissions

每个验证者都有一个案板,Berachef 合约管理所有案板。具体来说,它管理案板,以及我们所说的“厨师之友”,即经过治理批准的白名单金库,验证者可以在其中直接排放

3/ Validators use this under the hood in BGT Station to set how they want to distribute their BGT. Think of it as a pie chart—each section makes up a percentage of the whole, and each section maps to a rewards vault. View an example here - https://bartio.station.berachain.com/validators/0x2Ecd703B119C3FbFb2ec4b9FFa6d8756f7De9428

验证者在 BGT网站的后台使用它来设置如何分配 BGT。将其视为饼图 - 每个部分占整体的百分比,每个部分都映射到一个奖励金库。在此处查看示例 - https://bartio.station.berachain.com/validators/0x2Ecd703B119C3FbFb2ec4b9FFa6d8756f7De9428

4/ A rewards vault is just a smart contract that accepts one specific ERC20 as the asset to be staked, and the addresses of the governance-approved rewards vaults are added to the "friends of the chef," making them an eligible option for validators to direct BGT to.

奖励金库只是一个智能合约,接受一个特定的 ERC20 作为要质押的资产,并且经过治理批准的奖励金库的地址被添加到“厨师之友”中,使它们成为验证者将 BGT 定向的合格选择。

5/ To update their cutting board, this function queueNewCuttingBoard is called, which sets a delay before a new cutting board can go into effect. This makes it so validator preferences can't be changed too often, providing more predictability.

为了更新他们的案板,调用了这个函数queueNewCuttingBoard,它设置了新案板生效之前的延迟。这使得验证者的偏好不会经常改变,从而提供了更多的可预测性。

6/ We have this Weight struct which represents a weight entry and includes the address of the receiver Vault and the percentage that this weight is for!

我们有这个 Weight 结构,它代表一个权重条目,并包括接收者 Vault 的地址以及该权重所占的百分比!

7/ We also have a struct CuttingBoard that represents a cutting board. It includes the block this cutting board goes into effect, and an array of the Weights struct we just looked at.

我们还有一个 struct CuttingBoard 代表案板。它包括此案板生效的块,以及我们刚刚查看的权重结构数组。

8/ To review: 回顾

  • validators choose how to direct their BGT rewards via their cutting board. 验证者选择如何通过案板分配 BGT 奖励

  • the Berachef contract manages all the cutting boards Berachef 合约管理所有案板

  • validators can update their cutting boards as new rewards vaults get whitelisted, or as new incentives get added. 当新的奖励金库被列入白名单或添加新的激励措施时,验证者可以更新他们的案板。

9/ Note to the reader: You've seen reward vaults be referred to as gauges. Soon, we'll be updating our docs and UIs to use reward vaults as this is more clear. Check out this thread for more on PoL contracts! https://x.com/larrythecumber/status/1817960507137228899…

读者请注意:您已经看到奖励金库被称为仪表。很快,我们将更新我们的文档和 UI 以使用奖励金库,因为这会更加清晰。查看此主题,了解有关 PoL 合约的更多信息! https://x.com/larrythecumber/status/1817960507137228899…

Last updated