Skip to content

Berachef Berachain

Git Source

This precompile is responsible for configuring BGT emissions from validators to liquidity providers in berachain.

Note: Link to existing contract ABI's can be found on Github here.

Interface of the Berachef module's precompiled contract

Functions

getQueuedCuttingBoard

Returns the queued cuttingboard for validator with given operatorAddr

solidity
function getQueuedCuttingBoard(address operatorAddr) external view returns (CuttingBoard memory);
function getQueuedCuttingBoard(address operatorAddr) external view returns (CuttingBoard memory);

Parameters

NameTypeDescription
operatorAddraddressThe operator address of the validator.

Returns

NameTypeDescription
<none>CuttingBoardcuttingBoard The queued cuttingboard.

getActiveCuttingBoard

Returns the active cuttingboard for validator with given operatorAddr

solidity
function getActiveCuttingBoard(address operatorAddr) external view returns (CuttingBoard memory);
function getActiveCuttingBoard(address operatorAddr) external view returns (CuttingBoard memory);

Parameters

NameTypeDescription
operatorAddraddressThe operator address of the validator.

Returns

NameTypeDescription
<none>CuttingBoardcuttingBoard The active cuttingboard.

getDelegation

Returns the delegation address for a validator.

solidity
function getDelegation(address operatorAddr) external view returns (address);
function getDelegation(address operatorAddr) external view returns (address);

Returns

NameTypeDescription
<none>addressdelegationAddress the delegation address.

queueNewCuttingBoard

The weights of the cutting board must add up to 100. Only whitelisted pools may be used as well.

Add a new cuttingboard to the queue for validator with given operatorAddr.

solidity
function queueNewCuttingBoard(address operatorAddr, Weight[] calldata weights, int64 startEpoch)
    external
    payable
    returns (bool);
function queueNewCuttingBoard(address operatorAddr, Weight[] calldata weights, int64 startEpoch)
    external
    payable
    returns (bool);

Parameters

NameTypeDescription
operatorAddraddressThe operator address of the validator.
weightsWeight[]The weights of the cutting board.
startEpochint64The epoch that the cutting board starts at.

updateFriendsOfTheChef

The caller of this function must be the governance module account.

Updates the friends of the chef to update the status of if a LP pool is whitelisted or not.

solidity
function updateFriendsOfTheChef(address receiverAddress, bool friendOfTheChef) external returns (bool);
function updateFriendsOfTheChef(address receiverAddress, bool friendOfTheChef) external returns (bool);

Parameters

NameTypeDescription
receiverAddressaddressThe address to remove or add as a friend of the chef.
friendOfTheChefboolSets the whitelist status; true if the pool is being whitelisted, false otherwise.

setDelegation

Sets an address that can set cutting boards on a validator's behalf.

solidity
function setDelegation(address delegationAddress) external returns (bool);
function setDelegation(address delegationAddress) external returns (bool);

Parameters

NameTypeDescription
delegationAddressaddressThe address that can set cutting boards on a validator's behalf.

Events

QueueCuttingBoard

Emitted when a new cutting board has been queued.

solidity
event QueueCuttingBoard(address consensusAddr, Weight[] cuttingBoardWeights, int64 cuttingBoardStartEpoch);
event QueueCuttingBoard(address consensusAddr, Weight[] cuttingBoardWeights, int64 cuttingBoardStartEpoch);

Parameters

NameTypeDescription
consensusAddraddressThe validator's address.
cuttingBoardWeightsWeight[]The weights of the cutting board.
cuttingBoardStartEpochint64The epoch that the cutting board starts at.

Structs

CuttingBoard

Represents a CuttingBoard entry Note: the field names of the native struct should match these field names (by camelCase) Note: we are using the types in precompile/generated

solidity
struct CuttingBoard {
    address consAddr;
    Weight[] weights;
    int64 startEpoch;
}
struct CuttingBoard {
    address consAddr;
    Weight[] weights;
    int64 startEpoch;
}

Weight

Represents a Weight entry Note: the field names of the native struct should match these field names (by camelCase) Note: we are using the types in precompile/generated

solidity
struct Weight {
    address receiverAddress;
    uint256 percentageNumerator;
}
struct Weight {
    address receiverAddress;
    uint256 percentageNumerator;
}