RewardVaultFactory
Factory contract for creating RewardVaults and keeping track of them.
State Variables
VAULT_MANAGER_ROLE
The VAULT MANAGER role.
bytes32 public constant VAULT_MANAGER_ROLE = keccak256("VAULT_MANAGER_ROLE");
VAULT_PAUSER_ROLE
The VAULT PAUSER role.
bytes32 public constant VAULT_PAUSER_ROLE = keccak256("VAULT_PAUSER_ROLE");
beacon
The beacon address.
address public beacon;
bgt
The BGT token address.
address public bgt;
distributor
The distributor address.
address public distributor;
beaconDepositContract
The BeaconDeposit contract address.
address public beaconDepositContract;
getVault
Mapping of staking token to vault address.
mapping(address stakingToken => address vault) public getVault;
allVaults
Array of all vaults that have been created.
address[] public allVaults;
bgtIncentiveDistributor
The address of the BGTIncentiveDistributor contract to receive the BGT booster share of the incentive tokens.
address public bgtIncentiveDistributor;
Functions
constructor
Note: oz-upgrades-unsafe-allow: constructor
constructor();
initialize
function initialize(
address _bgt,
address _distributor,
address _beaconDepositContract,
address _governance,
address _vaultImpl
)
external
initializer;
_authorizeUpgrade
function _authorizeUpgrade(address newImplementation) internal override onlyRole(DEFAULT_ADMIN_ROLE);
setBGTIncentiveDistributor
Sets the BGTIncentiveDistributor contract.
Only callable by the admin.
function setBGTIncentiveDistributor(address _bgtIncentiveDistributor) external onlyRole(DEFAULT_ADMIN_ROLE);
Parameters
Name | Type | Description |
---|---|---|
_bgtIncentiveDistributor | address | The address of the new BGTIncentiveDistributor contract. |
createRewardVault
Creates a new reward vault vault for the given staking token.
Reverts if the staking token is not a contract.
function createRewardVault(address stakingToken) external returns (address);
Parameters
Name | Type | Description |
---|---|---|
stakingToken | address | The address of the staking token. |
Returns
Name | Type | Description |
---|---|---|
<none> | address | The address of the new vault. |
predictRewardVaultAddress
Predicts the address of the reward vault for the given staking token.
function predictRewardVaultAddress(address stakingToken) external view returns (address);
Parameters
Name | Type | Description |
---|---|---|
stakingToken | address | The address of the staking token. |
Returns
Name | Type | Description |
---|---|---|
<none> | address | The address of the reward vault. |
allVaultsLength
Gets the number of vaults that have been created.
function allVaultsLength() external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The number of vaults. |