Skip to content
🚧 Under Development! May be incomplete.Some pages/links may be incomplete or subject to change.

BlockRewardController

0x696C296D320beF7b3148420bf2Ff4a378c0a209B | ABI JSON

The BlockRewardController contract is responsible for managing the reward rate of BGT. Owned by the governance module, It is the only contract that can mint the BGT token.

Functions

baseRate

Returns the constant base rate for BGT.

solidity
function baseRate() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The constant base amount of BGT to be minted in the current block.

rewardRate

Returns the reward rate for BGT.

solidity
function rewardRate() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The unscaled amount of BGT to be minted in the current block.

minBoostedRewardRate

Returns the minimum boosted reward rate for BGT.

solidity
function minBoostedRewardRate() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The minimum amount of BGT to be minted in the current block.

boostMultiplier

Returns the boost mutliplier param in the reward function.

solidity
function boostMultiplier() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The parameter that determines the inflation cap.

rewardConvexity

Returns the reward convexity param in the reward function.

solidity
function rewardConvexity() external view returns (int256);

Returns

NameTypeDescription
<none>int256The parameter that determines how fast the function converges to its max.

computeReward

Computes the reward given specified parameters, according to the formula.

emission=[B+max(m,(a+1)(111+axb)R)]

Returns 0 for boost == 0 even if conv == 0, since contract enforces conv > 0.

solidity
function computeReward(
    uint256 boostPower,
    uint256 _rewardRate,
    uint256 _boostMultiplier,
    int256 _rewardConvexity
)
    external
    pure
    returns (uint256);

Parameters

NameTypeDescription
boostPoweruint256the normalized boost.
_rewardRateuint256the reward rate parameter.
_boostMultiplieruint256the boost multiplier parameter.
_rewardConvexityint256the reward convexity parameter.

Returns

NameTypeDescription
<none>uint256the reward amount.

processRewards

Processes the rewards for the specified block and mints BGT to validator's operator and distributor.

This function can only be called by the distributor.

If in genesis only base rate for validators is minted.

solidity
function processRewards(bytes calldata pubkey, uint64 nextTimestamp, bool isReady) external returns (uint256);

Parameters

NameTypeDescription
pubkeybytesThe validator's pubkey.
nextTimestampuint64The timestamp of the next beacon block that was processed.
isReadyboolThe flag to enable reward minting to distributor (true when BeraChef is ready).

Returns

NameTypeDescription
<none>uint256the amount of BGT minted to distributor.

setBaseRate

Sets the constant base reward rate for BGT.

This function can only be called by the owner, which is the governance address.

solidity
function setBaseRate(uint256 _baseRate) external;

Parameters

NameTypeDescription
_baseRateuint256The new base rate.

setRewardRate

Sets the reward rate for BGT.

This function can only be called by the owner, which is the governance address.

solidity
function setRewardRate(uint256 _rewardRate) external;

Parameters

NameTypeDescription
_rewardRateuint256The new reward rate.

setMinBoostedRewardRate

Sets the min boosted reward rate for BGT.

This function can only be called by the owner, which is the governance address.

solidity
function setMinBoostedRewardRate(uint256 _minBoostedRewardRate) external;

Parameters

NameTypeDescription
_minBoostedRewardRateuint256The new min boosted reward rate.

setBoostMultiplier

Sets the boost multiplier parameter for the reward formula.

This function can only be called by the owner, which is the governance address.

solidity
function setBoostMultiplier(uint256 _boostMultiplier) external;

Parameters

NameTypeDescription
_boostMultiplieruint256The new boost multiplier.

setRewardConvexity

Sets the reward convexity parameter for the reward formula.

This function can only be called by the owner, which is the governance address.

solidity
function setRewardConvexity(uint256 _rewardConvexity) external;

Parameters

NameTypeDescription
_rewardConvexityuint256The new reward convexity.

setDistributor

Sets the distributor contract that receives the minted BGT.

This function can only be called by the owner, which is the governance address.

solidity
function setDistributor(address _distributor) external;

Parameters

NameTypeDescription
_distributoraddressThe new distributor contract.

Events

BaseRateChanged

Emitted when the constant base rate has changed.

solidity
event BaseRateChanged(uint256 oldBaseRate, uint256 newBaseRate);

Parameters

NameTypeDescription
oldBaseRateuint256The old base rate.
newBaseRateuint256The new base rate.

RewardRateChanged

Emitted when the reward rate has changed.

solidity
event RewardRateChanged(uint256 oldRewardRate, uint256 newRewardRate);

Parameters

NameTypeDescription
oldRewardRateuint256The old reward rate.
newRewardRateuint256The new reward rate.

MinBoostedRewardRateChanged

Emitted when the min boosted reward rate has changed.

solidity
event MinBoostedRewardRateChanged(uint256 oldMinBoostedRewardRate, uint256 newMinBoostedRewardRate);

Parameters

NameTypeDescription
oldMinBoostedRewardRateuint256The old min boosted reward rate.
newMinBoostedRewardRateuint256The new min boosted reward rate.

BoostMultiplierChanged

Emitted when the boostMultiplier parameter has changed.

solidity
event BoostMultiplierChanged(uint256 oldBoostMultiplier, uint256 newBoostMultiplier);

Parameters

NameTypeDescription
oldBoostMultiplieruint256The old boost multiplier parameter.
newBoostMultiplieruint256The new boost multiplier parameter.

RewardConvexityChanged

Emitted when the reward formula convexity parameter has changed.

solidity
event RewardConvexityChanged(uint256 oldRewardConvexity, uint256 newRewardConvexity);

Parameters

NameTypeDescription
oldRewardConvexityuint256The old reward formula convexity parameter.
newRewardConvexityuint256The new reward formula convexity parameter.

SetDistributor

Emitted when the distributor is set.

solidity
event SetDistributor(address indexed rewardDistribution);

BlockRewardProcessed

Emitted when the rewards for the specified block have been processed.

solidity
event BlockRewardProcessed(bytes indexed pubkey, uint64 nextTimestamp, uint256 baseRate, uint256 rewardRate);

Parameters

NameTypeDescription
pubkeybytesThe validator's pubkey.
nextTimestampuint64The timestamp of the next beacon block that was processed.
baseRateuint256The base amount of BGT minted to the validator's operator.
rewardRateuint256The amount of BGT minted to the distributor.