-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Added _domainSeparatorWithoutChainId()
- Loading branch information
Showing
3 changed files
with
152 additions
and
18 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.4; | ||
|
||
import "../../../src/utils/EIP712.sol"; | ||
|
||
/// @dev WARNING! This mock is strictly intended for testing purposes only. | ||
/// Do NOT copy anything here into production code unless you really know what you are doing. | ||
contract MockEIP712DyanmicWithoutChainId is EIP712 { | ||
string private _name; | ||
string private _version; | ||
|
||
constructor(string memory name, string memory version) { | ||
_name = name; | ||
_version = version; | ||
} | ||
|
||
function setDomainNameAndVersion(string memory name, string memory version) public { | ||
_name = name; | ||
_version = version; | ||
} | ||
|
||
function _domainNameAndVersion() | ||
internal | ||
view | ||
override | ||
returns (string memory name, string memory version) | ||
{ | ||
name = _name; | ||
version = _version; | ||
} | ||
|
||
function _domainNameAndVersionMayChange() internal pure override returns (bool) { | ||
return true; | ||
} | ||
|
||
function hashTypedData(bytes32 structHash) external view returns (bytes32) { | ||
return _hashTypedData(structHash); | ||
} | ||
|
||
function DOMAIN_SEPARATOR() external view returns (bytes32) { | ||
return _domainSeparator(); | ||
} | ||
|
||
function _domainSeparatorWithoutChainId() internal pure override returns (bool) { | ||
return true; | ||
} | ||
} |