From ddbe2acbf52a75d24f9ae9ff7d1da072fbf58d46 Mon Sep 17 00:00:00 2001 From: Lawrence Forman Date: Tue, 25 Jun 2019 12:07:51 -0400 Subject: [PATCH] `@0x/contracts-utils`: Add LibEIP1271.sol --- contracts/utils/CHANGELOG.json | 4 +++ contracts/utils/compiler.json | 1 + contracts/utils/contracts/src/LibEIP1271.sol | 26 ++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 contracts/utils/contracts/src/LibEIP1271.sol diff --git a/contracts/utils/CHANGELOG.json b/contracts/utils/CHANGELOG.json index e6291f1b9f..ba3ac8e2b8 100644 --- a/contracts/utils/CHANGELOG.json +++ b/contracts/utils/CHANGELOG.json @@ -17,6 +17,10 @@ { "note": "Break out types/interaces from `MRichErrors` into `MRichErrorTypes`.", "pr": 1790 + }, + { + "note": "Add LibEIP1271.sol", + "pr": 1885 } ] }, diff --git a/contracts/utils/compiler.json b/contracts/utils/compiler.json index 942d46253d..600011d083 100644 --- a/contracts/utils/compiler.json +++ b/contracts/utils/compiler.json @@ -26,6 +26,7 @@ "contracts": [ "src/LibAddress.sol", "src/LibBytes.sol", + "src/LibEIP1271.sol", "src/LibEIP712.sol", "src/Ownable.sol", "src/ReentrancyGuard.sol", diff --git a/contracts/utils/contracts/src/LibEIP1271.sol b/contracts/utils/contracts/src/LibEIP1271.sol new file mode 100644 index 0000000000..0b8cbd2af8 --- /dev/null +++ b/contracts/utils/contracts/src/LibEIP1271.sol @@ -0,0 +1,26 @@ +/* + + Copyright 2019 ZeroEx Intl. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ + +pragma solidity ^0.5.9; + + +contract LibEIP1271 { + + // Magic bytes returned by EIP1271 wallets on success. + bytes4 constant public EIP1271_MAGIC_VALUE = 0x20c13b0b; +}