-
Notifications
You must be signed in to change notification settings - Fork 8
GovernanceUiHelper
senamakel edited this page Jan 20, 2025
·
1 revision
Utility contract to retrieve and format user’s staking and locking information, including APR, for front-end or off-chain access in the MAHA DAO ecosystem.
This contract fetches data from the OmnichainStakingToken contract, including reward rates,
total supply, and calculates APR based on locked balances and reward rates.
contract OmnichainStakingToken omnichainStakingThe staking contract associated with MAHA DAO governance for retrieving user’s locked balances
struct LockedBalanceWithApr {
uint256 id;
uint256 amount;
uint256 end;
uint256 start;
uint256 power;
uint256 apr;
}constructor(address _omnichainStakingToken) publicConstructor initializes the MahaUIHelper with the address of the OmnichainStakingToken contract.
| Name | Type | Description |
|---|---|---|
| _omnichainStakingToken | address | The address of the OmnichainStakingToken contract. |
function getLockDetails(address _userAddress) external view returns (struct GovernanceUiHelper.LockedBalanceWithApr[])Retrieves the details of all locked balances for a specified user.
Returns an array of LockedBalanceWithApr structs with details including lock amount,
APR calculation based on staking rewards, and lock duration.
| Name | Type | Description |
|---|---|---|
| _userAddress | address | The address of the user whose locked balances are retrieved. |
| Name | Type | Description |
|---|---|---|
| [0] | struct GovernanceUiHelper.LockedBalanceWithApr[] | lockDetails Array of LockedBalanceWithApr structs containing lock ID, amount, start and end dates, vePower, and scaled APR. |