Bribe Berachain
Note: Link to existing contract ABI's can be found on Github here.
This precompile is responsible for managing bribes directed at validators in the network. Below are functions that allow for viewing, and creating bribes.
Functions
getBribes
Gets the bribes for a given validator, start epoch pair.
function getBribes(address operator, uint64 startEpoch) external view returns (Bribe[] memory bribes);
function getBribes(address operator, uint64 startEpoch) external view returns (Bribe[] memory bribes);
Parameters
Name | Type | Description |
---|---|---|
operator | address | The validator operator address. |
startEpoch | uint64 | the epoch that the bribe begins at. |
Returns
Name | Type | Description |
---|---|---|
bribes | Bribe[] | An array of bribes |
getAllValidatorBribes
Gets all the bribes from the store for a given validator.
function getAllValidatorBribes(address operator) external view returns (Bribe[] memory bribes);
function getAllValidatorBribes(address operator) external view returns (Bribe[] memory bribes);
Parameters
Name | Type | Description |
---|---|---|
operator | address | The validator operator address. |
Returns
Name | Type | Description |
---|---|---|
bribes | Bribe[] | An array of bribes. |
getActiveValidatorBribes
Gets all the active bribes from the store for a given validator.
function getActiveValidatorBribes(address operator) external view returns (Bribe[] memory bribes);
function getActiveValidatorBribes(address operator) external view returns (Bribe[] memory bribes);
Parameters
Name | Type | Description |
---|---|---|
operator | address | The validator operator address. |
Returns
Name | Type | Description |
---|---|---|
bribes | Bribe[] | An array of bribes. |
getBribeFees
Gets the bribe fee from the store.
function getBribeFees() external view returns (Cosmos.Coin[] memory fee);
function getBribeFees() external view returns (Cosmos.Coin[] memory fee);
Returns
Name | Type | Description |
---|---|---|
fee | Cosmos.Coin[] | An array of bribe fees. |
updateParams
Updates the params. Only the authority can call this method.
function updateParams(Cosmos.Coin[] memory fee) external returns (bool);
function updateParams(Cosmos.Coin[] memory fee) external returns (bool);
Parameters
Name | Type | Description |
---|---|---|
fee | Cosmos.Coin[] | The new fee |
createBribe
Creates a new bribe. Only the authority can call this method. Note: Only one bribe can be created per validator per epoch.
function createBribe(
address operator,
uint64 startEpoch,
uint64 numBlockProposals,
Cosmos.Coin[] memory bribePerProposal
) external payable returns (bool);
function createBribe(
address operator,
uint64 startEpoch,
uint64 numBlockProposals,
Cosmos.Coin[] memory bribePerProposal
) external payable returns (bool);
Parameters
Name | Type | Description |
---|---|---|
operator | address | The validator operator address. |
startEpoch | uint64 | the epoch that the bribe begins at. |
numBlockProposals | uint64 | |
bribePerProposal | Cosmos.Coin[] |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | numBlockProposals The number of block proposals to bribe. |
Events
BribeCreated
Emitted when a bribe is created.
event BribeCreated(
address bribeCreator,
address consensusAddr,
uint64 startEpoch,
uint64 numBlockProposals,
Cosmos.Coin[] bribePerProposal
);
event BribeCreated(
address bribeCreator,
address consensusAddr,
uint64 startEpoch,
uint64 numBlockProposals,
Cosmos.Coin[] bribePerProposal
);
Parameters
Name | Type | Description |
---|---|---|
bribeCreator | address | The address of the bribe creator. |
consensusAddr | address | The validator's consensus address. |
startEpoch | uint64 | the epoch that the bribe matures. |
numBlockProposals | uint64 | |
bribePerProposal | Cosmos.Coin[] | Cosmos.Coin[] memory bribePerProposal |
Structs
Bribe
The struct for a bribe.
struct Bribe {
address consensusAddress;
uint64 startEpoch;
uint64 numBlockProposals;
uint64 numBlockProposalsBribed;
Cosmos.Coin[] bribePerProposal;
}
struct Bribe {
address consensusAddress;
uint64 startEpoch;
uint64 numBlockProposals;
uint64 numBlockProposalsBribed;
Cosmos.Coin[] bribePerProposal;
}
Properties
Name | Type | Description |
---|---|---|
consensusAddress | address | The validator consensus address. |
startEpoch | uint64 | the epoch that the bribe matures. |
numBlockProposals | uint64 | The number of block proposals to bribe. |
numBlockProposalsBribed | uint64 | The number of block proposals bribed so far. |
bribePerProposal | Cosmos.Coin[] | The amount to be paid per block proposal. |