Berachef Berachain
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
function getQueuedCuttingBoard(address operatorAddr) external view returns (CuttingBoard memory);
function getQueuedCuttingBoard(address operatorAddr) external view returns (CuttingBoard memory);
Parameters
Name | Type | Description |
---|---|---|
operatorAddr | address | The operator address of the validator. |
Returns
Name | Type | Description |
---|---|---|
<none> | CuttingBoard | cuttingBoard The queued cuttingboard. |
getActiveCuttingBoard
Returns the active cuttingboard for validator with given operatorAddr
function getActiveCuttingBoard(address operatorAddr) external view returns (CuttingBoard memory);
function getActiveCuttingBoard(address operatorAddr) external view returns (CuttingBoard memory);
Parameters
Name | Type | Description |
---|---|---|
operatorAddr | address | The operator address of the validator. |
Returns
Name | Type | Description |
---|---|---|
<none> | CuttingBoard | cuttingBoard The active cuttingboard. |
getDelegation
Returns the delegation address for a validator.
function getDelegation(address operatorAddr) external view returns (address);
function getDelegation(address operatorAddr) external view returns (address);
Returns
Name | Type | Description |
---|---|---|
<none> | address | delegationAddress 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.
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
Name | Type | Description |
---|---|---|
operatorAddr | address | The operator address of the validator. |
weights | Weight[] | The weights of the cutting board. |
startEpoch | int64 | The 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.
function updateFriendsOfTheChef(address receiverAddress, bool friendOfTheChef) external returns (bool);
function updateFriendsOfTheChef(address receiverAddress, bool friendOfTheChef) external returns (bool);
Parameters
Name | Type | Description |
---|---|---|
receiverAddress | address | The address to remove or add as a friend of the chef. |
friendOfTheChef | bool | Sets 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.
function setDelegation(address delegationAddress) external returns (bool);
function setDelegation(address delegationAddress) external returns (bool);
Parameters
Name | Type | Description |
---|---|---|
delegationAddress | address | The address that can set cutting boards on a validator's behalf. |
Events
QueueCuttingBoard
Emitted when a new cutting board has been queued.
event QueueCuttingBoard(address consensusAddr, Weight[] cuttingBoardWeights, int64 cuttingBoardStartEpoch);
event QueueCuttingBoard(address consensusAddr, Weight[] cuttingBoardWeights, int64 cuttingBoardStartEpoch);
Parameters
Name | Type | Description |
---|---|---|
consensusAddr | address | The validator's address. |
cuttingBoardWeights | Weight[] | The weights of the cutting board. |
cuttingBoardStartEpoch | int64 | The 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
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
struct Weight {
address receiverAddress;
uint256 percentageNumerator;
}
struct Weight {
address receiverAddress;
uint256 percentageNumerator;
}