0

With this isValidSignature function:

// NOTE: This method not safe, contract may attack by signature replay.
    /**
     * Verify if the signer has a valid signature as claimed
     * @param signer The address of user who wants to perform an action
     * @param signature The signature signed by the signer
     */
    function isValidSignature(address signer, bytes memory signature)
        public
        view
        returns (bool)
    {
       
        bytes32 messageHash = keccack256(abi.encodePacked(***byte***(0x19), byte(0), address(this), signer));
        return ECDSA.recover(messageHash, signature) == signer;
    }

I get linting for byte(0x19) stating there is an "Expected Primary Expression". Why does this happen?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.