Skip to content

Commit

Permalink
refactor!: remove EIP191Signer library to use function from OZ library
Browse files Browse the repository at this point in the history
  • Loading branch information
CJ42 committed Jun 21, 2023
1 parent e1a0379 commit 19a6de9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
11 changes: 0 additions & 11 deletions contracts/Custom/EIP191Signer.sol

This file was deleted.

6 changes: 2 additions & 4 deletions contracts/LSP6KeyManager/LSP6KeyManagerCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {BytesLib} from "solidity-bytes-utils/contracts/BytesLib.sol";
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {LSP6Utils} from "./LSP6Utils.sol";
import {EIP191Signer} from "../Custom/EIP191Signer.sol";

// errors
import {
Expand Down Expand Up @@ -70,8 +69,7 @@ abstract contract LSP6KeyManagerCore is
LSP6OwnershipModule
{
using LSP6Utils for *;
using ECDSA for bytes32;
using EIP191Signer for address;
using ECDSA for *;
using BytesLib for bytes;

address internal _target;
Expand Down Expand Up @@ -339,7 +337,7 @@ abstract contract LSP6KeyManagerCore is
payload
);

address signer = address(this).toDataWithIntendedValidator(encodedMessage).recover(
address signer = address(this).toDataWithIntendedValidatorHash(encodedMessage).recover(
signature
);

Expand Down
4 changes: 2 additions & 2 deletions contracts/Mocks/EIP191SignerTester.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.4;

import {EIP191Signer} from "../Custom/EIP191Signer.sol";
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";

contract EIP191SignerTester {
function toDataWithIntendedValidator(
address validator,
bytes memory dataToSign
) public pure returns (bytes32) {
return EIP191Signer.toDataWithIntendedValidator(validator, dataToSign);
return ECDSA.toDataWithIntendedValidatorHash(validator, dataToSign);
}
}

0 comments on commit 19a6de9

Please sign in to comment.