Skip to content

Commit

Permalink
feat: parameter validation for modules (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmoebius authored Dec 12, 2023
1 parent a31dfb6 commit 49fc8fa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions solidity/contracts/Module.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ abstract contract Module is IModule {
address _finalizer
) external virtual onlyOracle {}

/// @inheritdoc IModule
function validateParameters(bytes calldata _encodedParameters) external pure virtual returns (bool _valid) {}

/**
* @notice Computes the id a given request
*
Expand Down
8 changes: 8 additions & 0 deletions solidity/interfaces/IModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ interface IModule {
address _finalizer
) external;

/**
* @notice Validates parameters prior to creating a request
*
* @param _encodedParameters The encoded parameters for the request
* @param _valid Boolean indicating if the parameters are valid or not
*/
function validateParameters(bytes memory _encodedParameters) external pure returns (bool _valid);

/**
* @notice Returns the name of the module.
*
Expand Down

0 comments on commit 49fc8fa

Please sign in to comment.