Skip to main content

IShPolicy Interface

Policy Management Functions

These functions allow users to commit/uncommit their ShMONAD tokens and manage their re-staked positions in the ShMonad contract.


createPolicy

function createPolicy(uint48 escrowDuration) external returns (uint64 policyID, address policyERC20Wrapper);

Creates a new policy with a specified escrowDuration. Returns the new policyID and the address of the associated wrapped ERC-20.

Parameters

NameTypeDescription
escrowDurationuint48Duration of escrow associated with this policy

Returns

NameTypeDescription
policyIDuint64Unique identifier for the newly created policy
policyERC20WrapperaddressAddress of the ERC-20 wrapper for the policy

addPolicyAgent

function addPolicyAgent(uint64 policyID, address agent) external;

Adds agent as an authorized policy agent under policyID.

removePolicyAgent

function removePolicyAgent(uint64 policyID, address agent) external;

Removes agent from authorized policy agents under policyID.

disablePolicy

function disablePolicy(uint64 policyID) external;

Disables (or deactivates) a policy, preventing further bonding or agent operations.


View Functions

policyCount

function policyCount() external view returns (uint64);

Returns the total number of policies created.

getPolicy

function getPolicy(uint64 policyID) external view returns (Policy memory);

Retrieves the Policy struct details for a given policyID.

isPolicyAgent

function isPolicyAgent(uint64 policyID, address agent) external view returns (bool);

Checks if agent is recognized as an authorized agent under policyID.

getPolicyAgents

function getPolicyAgents(uint64 policyID) external view returns (address[] memory);

Lists all agents for a given policyID.

getHoldAmount

function getHoldAmount(uint64 policyID, address account) external view returns (uint256);

Returns the total tokens under hold for account in the specified policyID.

unbondingCompleteBlock

function unbondingCompleteBlock(uint64 policyID, address account) external view returns (uint256);

Returns the block number at which unbonding completes for a given policyID and account.

balanceOfBonded

function balanceOfBonded(uint64 policyID, address account) external view returns (uint256);

Returns the bonded token balance of account for policyID.

balanceOfUnbonding

function balanceOfUnbonding(uint64 policyID, address account) external view returns (uint256);

Returns the unbonding token balance of account for policyID.