Skip to content

Commit

Permalink
make frozen state an enum
Browse files Browse the repository at this point in the history
  • Loading branch information
seunlanlege committed Jul 24, 2024
1 parent f137728 commit 5af17b2
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 19 deletions.
3 changes: 1 addition & 2 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[profile.default]
src = 'src'
src = 'interfaces'
out = 'out'
libs = ['lib']

50 changes: 34 additions & 16 deletions interfaces/IIsmpHost.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ struct ResponseReceipt {
address relayer;
}

// Various frozen states of the IIsmpHost
enum FrozenStatus {
// Host is operating normally
None,
// Host is currently disallowing incoming datagrams
Incoming,
// Host is currently disallowing outgoing messages
Outgoing,
// All actions have been frozen
All
}

/**
* @title The Ismp Host Interface
* @author Polytope Labs ([email protected])
Expand Down Expand Up @@ -64,22 +76,22 @@ interface IIsmpHost is IDispatcher {
*/
function timestamp() external view returns (uint256);

/**
* @dev Returns the nonce immediately available for requests
* @return the `nonce`
*/
function nonce() external view returns (uint256);
/**
* @dev Returns the nonce immediately available for requests
* @return the `nonce`
*/
function nonce() external view returns (uint256);

/**
* @dev Returns the fisherman responsible for vetoing the given state machine height.
* @return the `fisherman` address
*/
function vetoes(uint256 paraId, uint256 height) external view returns (address);
/**
* @dev Returns the fisherman responsible for vetoing the given state machine height.
* @return the `fisherman` address
*/
function vetoes(uint256 paraId, uint256 height) external view returns (address);

/**
* @return the `frozen` status
*/
function frozen() external view returns (bool);
function frozen() external view returns (FrozenStatus);

/**
* @dev Returns the address for the Uniswap V2 Router implementation used for swaps
Expand Down Expand Up @@ -132,11 +144,11 @@ interface IIsmpHost is IDispatcher {
*/
function consensusState() external view returns (bytes memory);

/**
* @dev Check the response status for a given request.
* @return `response` status
*/
function responded(bytes32 commitment) external view returns (bool);
/**
* @dev Check the response status for a given request.
* @return `response` status
*/
function responded(bytes32 commitment) external view returns (bool);

/**
* @param commitment - commitment to the request
Expand Down Expand Up @@ -172,6 +184,12 @@ interface IIsmpHost is IDispatcher {
*/
function unStakingPeriod() external view returns (uint256);

/**
* @dev set the new frozen state of the host, only the admin or handler can call this.
* @param newState - the new frozen state
*/
function setFrozenState(FrozenStatus newState) external;

/**
* @dev Store an encoded consensus state
* @param state new consensus state
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polytope-labs/ismp-solidity",
"version": "0.2.7",
"version": "0.3.0",
"description": "Hyperbridge Solidity SDK for the Interoperable state machine protocol",
"author": "Polytope Labs <[email protected]>",
"license": "Apache-2.0",
Expand Down

0 comments on commit 5af17b2

Please sign in to comment.