Skip to main content

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.

note

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

NameTypeDescription
shMonAmountuint256The amount of shMON to burn
fromaddressThe address whose shMON will be burned
note

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

NameTypeDescription
policyIDuint64The identifier of the policy to bond into
bondRecipientaddressThe address that will receive the bonded position
amountuint256The 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

NameTypeDescription
policyIDuint64The identifier of the policy to bond into
bondRecipientaddressThe address that will receive the bonded position
amountToBonduint256The 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

NameTypeDescription
policyIDuint64The identifier of the policy to unbond from
amountuint256The amount of tokens to unbond
newMinBalanceuint256Minimum balance to maintain in bonded state

Returns

TypeDescription
uint256The block number when unbonding will complete

claim

function claim(uint64 policyID, uint256 amount) external;

Claim unbonded tokens after the escrow period.

Parameters

NameTypeDescription
policyIDuint64The policy to claim from
amountuint256The 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

NameTypeDescription
policyIDuint64The policy to claim from
amountuint256The amount to claim and withdraw

Returns

TypeDescription
uint256The 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

NameTypeDescription
policyIDuint64The policy containing the tokens
accountaddressThe account whose tokens to hold
amountuint256The 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

NameTypeDescription
policyIDuint64The policy providing the payment guarantee
payoraddressThe account paying for execution
recipientaddressThe recipient of any returns
msgValueuint256Value to send with the call
gasLimituint256Maximum gas for execution
callTargetaddressContract to call
callDatabytesEncoded function call data

Returns

NameTypeDescription
actualPayorCostuint128The actual cost charged to the payor
successboolWhether the execution succeeded
returnDatabytesData 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

NameTypeDescription
escrowDurationuint48The duration tokens must remain in escrow when unbonding

Returns

NameTypeDescription
policyIDuint64The ID of the created policy
policyERC20WrapperaddressThe 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 policy
  • removePolicyAgent: Remove an agent from a policy
  • isPolicyAgent: 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 policy
  • balanceOfUnbonding: Get unbonding balance in a policy
  • getHoldAmount: 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 details
  • getPolicyAgents: Get list of policy agents
  • policyCount: 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

NameTypeDescription
policyIDuint64The policy ID to check
accountaddressThe account to check

Returns

TypeDescription
uint256Block number when unbonding completes