Skip to main content

LSP20CallVerification

LSP20CallVerification

Standard Specifications
Solidity implementation

Implementation of a contract calling the verification functions according to LSP20 - Call Verification standard.

Module to be inherited used to verify the execution of functions according to a verifier address. Verification can happen before or after execution based on a magicValue.

Internal Methods

Any method labeled as internal serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs.

Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities.

_verifyCall

function _verifyCall(
address logicVerifier
) internal nonpayable returns (bool verifyAfter);

Calls lsp20VerifyCall function on the logicVerifier. Reverts in case the value returned does not match the magic value (lsp20VerifyCall selector) Returns whether a verification after the execution should happen based on the last byte of the magicValue


_verifyCallResult

function _verifyCallResult(
address logicVerifier,
bytes callResult
) internal nonpayable;

Calls lsp20VerifyCallResult function on the logicVerifier. Reverts in case the value returned does not match the magic value (lsp20VerifyCallResult selector)


_validateCall

function _validateCall(
bool postCall,
bool success,
bytes returnedData
) internal pure;

_revertWithLSP20DefaultError

function _revertWithLSP20DefaultError(
bool postCall,
bytes returnedData
) internal pure;