Skip to content

RewardVaultFactory

0x94Ad6Ac84f6C6FbA8b8CCbD71d9f4f101def52a8 | ABI JSON

Factory contract for creating RewardVaults and keeping track of them.

State Variables

VAULT_MANAGER_ROLE

The VAULT MANAGER role.

solidity
bytes32 public constant VAULT_MANAGER_ROLE = keccak256("VAULT_MANAGER_ROLE");

VAULT_PAUSER_ROLE

The VAULT PAUSER role.

solidity
bytes32 public constant VAULT_PAUSER_ROLE = keccak256("VAULT_PAUSER_ROLE");

beacon

The beacon address.

solidity
address public beacon;

bgt

The BGT token address.

solidity
address public bgt;

distributor

The distributor address.

solidity
address public distributor;

beaconDepositContract

The BeaconDeposit contract address.

solidity
address public beaconDepositContract;

getVault

Mapping of staking token to vault address.

solidity
mapping(address stakingToken => address vault) public getVault;

allVaults

Array of all vaults that have been created.

solidity
address[] public allVaults;

bgtIncentiveDistributor

The address of the BGTIncentiveDistributor contract to receive the BGT booster share of the incentive tokens.

solidity
address public bgtIncentiveDistributor;

bgtIncentiveFeeCollector

The address of the Incentive Fee Collector contract that receives incentive fees for BERA stakers (PoL).

solidity
address public bgtIncentiveFeeCollector;

bgtIncentiveFeeRate

The fee rate for incentive collection, expressed in basis points (10000 = 100%). Currently set to 3300 (33%).

solidity
uint256 public bgtIncentiveFeeRate;

Functions

constructor

Note: oz-upgrades-unsafe-allow: constructor

solidity
constructor();

initialize

solidity
function initialize(
    address _bgt,
    address _distributor,
    address _beaconDepositContract,
    address _governance,
    address _vaultImpl
)
    external
    initializer;

_authorizeUpgrade

solidity
function _authorizeUpgrade(address newImplementation) internal override onlyRole(DEFAULT_ADMIN_ROLE);

setBGTIncentiveDistributor

Sets the BGTIncentiveDistributor contract.

Only callable by the admin.

solidity
function setBGTIncentiveDistributor(address _bgtIncentiveDistributor) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
_bgtIncentiveDistributoraddressThe address of the new BGTIncentiveDistributor contract.

setBGTIncentiveFeeCollector

Sets the Incentive Fee Collector contract.

Only callable by the admin.

solidity
function setBGTIncentiveFeeCollector(address _bgtIncentiveFeeCollector) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
_bgtIncentiveFeeCollectoraddressThe address of the new Incentive Fee Collector contract.

setBGTIncentiveFeeRate

Sets the incentive fee rate.

Only callable by the admin.

solidity
function setBGTIncentiveFeeRate(uint256 _bgtIncentiveFeeRate) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
_bgtIncentiveFeeRateuint256The new fee rate in basis points (10000 = 100%).

createRewardVault

Creates a new reward vault vault for the given staking token.

Reverts if the staking token is not a contract.

solidity
function createRewardVault(address stakingToken) external returns (address);

Parameters

NameTypeDescription
stakingTokenaddressThe address of the staking token.

Returns

NameTypeDescription
<none>addressThe address of the new vault.

predictRewardVaultAddress

Predicts the address of the reward vault for the given staking token.

solidity
function predictRewardVaultAddress(address stakingToken) external view returns (address);

Parameters

NameTypeDescription
stakingTokenaddressThe address of the staking token.

Returns

NameTypeDescription
<none>addressThe address of the reward vault.

allVaultsLength

Gets the number of vaults that have been created.

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

Returns

NameTypeDescription
<none>uint256The number of vaults.