Created
May 5, 2022 03:43
-
-
Save MarcoWorms/141ffff04d530490b2a5275556f283b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @notice Determine whether or not a given target and calldata is valid | |
* @dev In order to be valid, target and calldata must pass the allowlist conditions tests | |
* @param targetAddress The target address of the method call | |
* @param data The raw calldata of the call | |
* @return isValid True if valid, false if not | |
*/ | |
function validateCalldataByOrigin( | |
string memory originName, | |
address targetAddress, | |
bytes calldata data | |
) public view returns (bool isValid) { | |
address allowlistAddress = allowlistAddressByOriginName[originName]; | |
isValid = CalldataValidation.validateCalldataByAllowlist( | |
allowlistAddress, | |
targetAddress, | |
data | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment