shMONAD Interface
The IShMONAD
interface provides the core functionality for staking, bonding, and policy management in the shMONAD system.
Account Functions
boostYield
There are two ways to boost yield for shMON holders:
function boostYield() external payable;
Boost yield by directly contributing MON tokens which are distributed as yield to all shMON holders.
The sent MON tokens are added directly to the yield pool, increasing the value of all shMON tokens.
function boostYield(uint256 shMonAmount, address from) external;
Boost yield by burning shMON shares, which increases the value of remaining shares.
Parameters
Name | Type | Description |
---|---|---|
shMonAmount | uint256 | The amount of shMON to burn |
from | address | The address whose shMON will be burned |
The native tokens (MON) backing the burned shMON intentionally remain in ShMonad as yield for other holders, effectively increasing the MON/shMON ratio for all remaining holders.
bond
function bond(
uint64 policyID,
address bondRecipient,
uint256 amount
) external;
Bond shMON tokens into a specific policy.
Parameters
Name | Type | Description |
---|---|---|
policyID | uint64 | The identifier of the policy to bond into |
bondRecipient | address | The address that will receive the bonded position |
amount | uint256 | The amount of shMON to bond |
depositAndBond
function depositAndBond(
uint64 policyID,
address bondRecipient,
uint256 amountToBond
) external payable;
Deposit MON and bond the resulting shMON in one transaction.
Parameters
Name | Type | Description |
---|---|---|
policyID | uint64 | The identifier of the policy to bond into |
bondRecipient | address | The address that will receive the bonded position |
amountToBond | uint256 | The amount of MON to deposit and bond |
unbond
function unbond(
uint64 policyID,
uint256 amount,
uint256 newMinBalance
) external returns (uint256 unbondBlock);
Initiate unbonding of tokens from a policy.
Parameters
Name | Type | Description |
---|---|---|
policyID | uint64 | The identifier of the policy to unbond from |
amount | uint256 | The amount of tokens to unbond |
newMinBalance | uint256 | Minimum balance to maintain in bonded state |
Returns
Type | Description |
---|---|
uint256 | The block number when unbonding will complete |
claim
function claim(uint64 policyID, uint256 amount) external;
Claim unbonded tokens after the escrow period.
Parameters
Name | Type | Description |
---|---|---|
policyID | uint64 | The policy to claim from |
amount | uint256 | The amount to claim |
claimAndWithdraw
function claimAndWithdraw(
uint64 policyID,
uint256 amount
) external returns (uint256 shares);
Claim unbonded tokens and withdraw to MON in one transaction.
Parameters
Name | Type | Description |
---|---|---|
policyID | uint64 | The policy to claim from |
amount | uint256 | The amount to claim and withdraw |
Returns
Type | Description |
---|---|
uint256 | The amount of MON received |
Agent Functions
hold
function hold(
uint64 policyID,
address account,
uint256 amount
) external;
Place a hold on bonded tokens to prevent unbonding.
Parameters
Name | Type | Description |
---|---|---|
policyID | uint64 | The policy containing the tokens |
account | address | The account whose tokens to hold |
amount | uint256 | The amount to hold |
agentExecuteWithSponsor
function agentExecuteWithSponsor(
uint64 policyID,
address payor,
address recipient,
uint256 msgValue,
uint256 gasLimit,
address callTarget,
bytes calldata callData
) external payable returns (uint128 actualPayorCost, bool success, bytes memory returnData);
Execute a transaction using bonded tokens as payment guarantee.
Parameters
Name | Type | Description |
---|---|---|
policyID | uint64 | The policy providing the payment guarantee |
payor | address | The account paying for execution |
recipient | address | The recipient of any returns |
msgValue | uint256 | Value to send with the call |
gasLimit | uint256 | Maximum gas for execution |
callTarget | address | Contract to call |
callData | bytes | Encoded function call data |
Returns
Name | Type | Description |
---|---|---|
actualPayorCost | uint128 | The actual cost charged to the payor |
success | bool | Whether the execution succeeded |
returnData | bytes | Data returned from the call |
Policy Management
createPolicy
function createPolicy(
uint48 escrowDuration
) external returns (uint64 policyID, address policyERC20Wrapper);
Create a new policy with specified escrow duration.
Parameters
Name | Type | Description |
---|---|---|
escrowDuration | uint48 | The duration tokens must remain in escrow when unbonding |
Returns
Name | Type | Description |
---|---|---|
policyID | uint64 | The ID of the created policy |
policyERC20Wrapper | address | The address of the policy's ERC20 wrapper |
Policy Agent Management
function addPolicyAgent(uint64 policyID, address agent) external;
function removePolicyAgent(uint64 policyID, address agent) external;
function isPolicyAgent(uint64 policyID, address agent) external view returns (bool);
Functions to manage policy agents:
addPolicyAgent
: Add an agent to a policyremovePolicyAgent
: Remove an agent from a policyisPolicyAgent
: Check if an address is a policy agent
View Functions
Balance Queries
function balanceOfBonded(uint64 policyID, address account) external view returns (uint256);
function balanceOfUnbonding(uint64 policyID, address account) external view returns (uint256);
function getHoldAmount(uint64 policyID, address account) external view returns (uint256);
Functions to query various balances:
balanceOfBonded
: Get bonded balance in a policybalanceOfUnbonding
: Get unbonding balance in a policygetHoldAmount
: Get amount of tokens on hold
Policy Information
function getPolicy(uint64 policyID) external view returns (Policy memory);
function getPolicyAgents(uint64 policyID) external view returns (address[] memory);
function policyCount() external view returns (uint64);
Functions to query policy information:
getPolicy
: Get full policy detailsgetPolicyAgents
: Get list of policy agentspolicyCount
: Get total number of policies
Unbonding Status
function unbondingCompleteBlock(
uint64 policyID,
address account
) external view returns (uint256);
Get the block number when unbonding will complete for an account.
Parameters
Name | Type | Description |
---|---|---|
policyID | uint64 | The policy ID to check |
account | address | The account to check |
Returns
Type | Description |
---|---|
uint256 | Block number when unbonding completes |