Contract Interface, ABI, & Functions
Details on select functions, along with the full StakedMonad contract interface.
Condensed StakedMonad Contract Interface
The full interface can be found in our published package. This condensed interface contains the most important functions for integrating with the Kintsu core protocol.
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.26;
interface IStakedMonad {
struct UnlockRequest {
uint96 shares;
uint40 batchId;
}
struct UnlockRequestBatch {
uint96 shares;
uint96 spotValue;
uint40 submissionTime;
}
/// @notice Converts MON into LST shares at the current block timestamp
/// @dev `totalShares()` accounts for both minted and mintable shares
function convertToShares(uint96 assets) external view returns (uint96 shares);
/// @notice Converts LST shares into MON at the current block timestamp
/// @dev `totalShares()` accounts for both minted and mintable shares
function convertToAssets(uint96 shares) external view returns (uint96 assets);
function getBatchUnlockIdAtTime(uint256 timestamp) external view returns (uint40 batchId);
/// @notice Deposit MON into the protocol and receive LST shares to represent your position
/// @notice MON must be greater than minimum stake
/// @dev Deposit amount must be specified by `msg.value`
/// @dev First param `assets` satisfies ERC7535/ERC4626
/// @param receiver - Recipient of the minted shares
/// @return shares - Quantity of shares minted
function deposit(uint96, address receiver) external payable returns (uint96 shares);
function previewDeposit(uint96 assets) external view returns (uint96 shares);
/// @notice Mint LST shares to represent your position of MON deposited into the protocol
/// @notice MON must be greater than minimum stake
/// @dev Deposit amount must be specified by `msg.value`
/// @param shares - Number of shares desired
/// @param receiver - Recipient of the minted shares
/// @return assets - MON deposited
function mint(uint96 shares, address receiver) external payable returns (uint96 assets);
function previewMint(uint96 shares) external view returns (uint96 assets);
/// @notice Step 1 of 2 in process of withdrawing staked MON
/// @notice Transfers LST specified in `shares` argument to the vault contract
/// @notice Unlock is batched into current batch request
function requestUnlock(uint96 shares) external;
/// @notice Allow user to cancel their unlock request
/// @notice Most users will have 1 concurrent unlock request (`unlockIndex` == 0) but advanced users may have more
/// @notice Must be done in the same batch interval in which the request was originally sent
/// @dev Order of unlock requests is not guaranteed between cancellations
function cancelUnlockRequest(uint256 unlockIndex) external;
/// @notice Step 2 of 2 in process of withdrawing staked MON
/// @notice Returns original deposit amount plus interest to depositor address
/// @notice Transfers MON to caller
/// @notice Associated batch unlock request must have been completed
/// @dev Deletes the caller's unlock request
function redeem(uint256 unlockIndex, address payable receiver) external returns (uint96 assets);
/// @notice Compound earned rewards for all validators
/// @dev Can be called by anyone
function compound() external;
/// @notice Trigger unlock requests of previous batched requests
/// @notice Distributes unlock requests to nominators according to current stake imbalances
/// @notice Calculates a batch spot values for LST in the batches
/// @notice Burns associated LST
/// @dev Batch IDs must be specified in ascending order (for gas efficient duplicate check)
/// @dev Cannot be called for a batch that has not concluded
/// @dev Cannot be called for a batch that has already been redeemed
function sendBatchUnlockRequests(uint40[] calldata batchIds) external;
/// @notice Attempts to claim unbonded MON from all nodes
function withdrawUnbonded() external;
/// @notice Shares that could exist at the current block timestamp
/// @notice Includes both minted and mintable shares
function totalShares() external view returns (uint96);
/// @notice Shares that could be minted by the protocol at the current block timestamp
function mintableProtocolShares() external view returns (uint96 shares);
function getAllUserUnlockRequests(address user) external view returns (UnlockRequest[] memory);
}
StakedMonad Contract ABI
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.30;
interface IStakedMonad {
struct Node {
uint64 id;
uint96 weight;
uint96 staked;
}
struct UnlockRequest {
/// @dev Number of shares the user will receive if the request is cancelled
uint96 shares;
/// @dev Value of the underlying asset that will be received upon redemption
uint96 spotValue;
/// @dev When this batch is completed, redemption is available after a delay
uint40 batchId;
/// @dev Store the exitFee (expressed in basis points) used for processing
uint16 exitFeeInBips;
}
/**
* @notice View all unique node ids in their current order
* @dev The order is not guaranteed to remain constant between calls
* @dev The order is not guaranteed to correlate to a position in `getNodes()`
*/
function getNodeIds() external view returns (uint256[] memory);
/**
* @notice View all nodes in their current order
* @dev The order is not guaranteed to remain constant between calls
*/
function getNodes() external view returns (Node[] memory);
/// @notice View a node by its unique node id
function viewNodeByNodeId(uint64 nodeId) external view returns (Node memory node);
/**
* @notice Converts MON into LST shares at the current block timestamp
*/
function convertToShares(uint96 assets) external view returns (uint96 shares);
/**
* @notice Converts LST shares into MON at the current block timestamp
* @notice Does not apply exit fee
*/
function convertToAssets(uint96 shares) external view returns (uint96 assets);
/**
* @notice Shares that could exist at the current block timestamp
* @notice Includes both minted and mintable shares
*/
function totalShares() external view returns (uint96);
function getAllUserUnlockRequests(address user) external view returns (UnlockRequest[] memory);
function getExitFeeBips() external view returns (uint16);
function getManagementFeeBips() external view returns (uint16);
/// @notice Shares that could be minted by the protocol at the current block timestamp
function getMintableProtocolShares() external view returns (uint96 shares);
/**
* @notice Deposit asset into the protocol and receive shares to represent your position
* @notice Deposit amount must be specified by `msg.value`
* @param minShares - Minimum quantity of shares that must be minted to prevent front running
* @param receiver - Recipient of the minted shares
* @return shares - Quantity of shares minted
*/
function deposit(uint96 minShares, address receiver) external payable returns (uint96 shares);
/*
* @notice Step 1 of 2 in process of withdrawing assets
* @notice Transfers `shares` to the vault contract
* @notice Unlock is batched into current batch request
* @notice Applies exit fee if present
*/
function requestUnlock(uint96 shares, uint96 minSpotValue) external returns (uint96 spotValue);
/**
* @notice Allow user to cancel their unlock request
* @notice Most users will have 1 concurrent unlock request (`unlockIndex` == 0) but advanced users may have more
* @notice Must be done before the associated batch is submitted
* @dev Order of unlock requests is not guaranteed between cancellations
*/
function cancelUnlockRequest(uint256 unlockIndex) external;
/**
* @notice Step 2 of 2 in process of withdrawing assets
* @notice Associated batch must have been submitted and the cooldown period elapsed
* @dev Might need to first call `sweep()` to make funds available
* @dev Deletes the caller's unlock request
*/
function redeem(uint256 unlockIndex, address payable receiver) external returns (uint96 assets);
/**
* @notice Processes deposit and withdrawal requests and allocates MON according to Registry weights
* @dev Might need to first call `sweep()`
*/
function submitBatch() external;
/**
* @notice Withdraws MON from completed un-delegations
* @notice Stores withdrawn funds in the contract to fund redemptions
* @dev Required number of epochs must have passed since calling `undelegate`
* @dev All withdrawals must be valid and complete or none will
*/
function sweep(uint64[] memory nodeIds, uint8 maxWithdrawsPerNode) external;
/**
* @notice Claims all claimable rewards and adds them to the next batch
* @dev Specifying an invalid node id will revert
*/
function compound(uint64[] memory nodeIds) external;
/**
* @notice Allows external funds to be added without minting shares
* @dev Restricts usage when total pooled is below a threshold to prevent share inflation attacks
* @param benefactor - Address used for tracking who is responsible for the contribution
*/
function contributeToPool(address benefactor) external payable;
}
Last updated