File tree 3 files changed +45
-0
lines changed
3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ // SPDX-License-Identifier: MIT
2
+
3
+ pragma solidity ^ 0.8.20 ;
4
+
5
+ import { _IERC2771 } from './_IERC2771.sol ' ;
6
+
7
+ interface IERC2771 is _IERC2771 {
8
+ function isTrustedForwarder (address forwarder ) external view returns (bool );
9
+ }
Original file line number Diff line number Diff line change
1
+ // SPDX-License-Identifier: MIT
2
+
3
+ pragma solidity ^ 0.8.20 ;
4
+
5
+ interface _IERC2771 {}
Original file line number Diff line number Diff line change
1
+ // SPDX-License-Identifier: MIT
2
+
3
+ pragma solidity ^ 0.8.20 ;
4
+
5
+ library ERC2771Storage {
6
+ /**
7
+ * @custom:storage-location erc7201:solidstate.contracts.storage.ERC2771
8
+ */
9
+ struct Layout {
10
+ mapping (address account = > bool trustedStatus ) trustedForwarders;
11
+ }
12
+
13
+ bytes32 internal constant DEFAULT_STORAGE_SLOT =
14
+ keccak256 (
15
+ abi.encode (
16
+ uint256 (
17
+ keccak256 (bytes ('solidstate.contracts.storage.ERC2771 ' ))
18
+ ) - 1
19
+ )
20
+ ) & ~ bytes32 (uint256 (0xff ));
21
+
22
+ function layout () internal pure returns (Layout storage $) {
23
+ $ = layout (DEFAULT_STORAGE_SLOT);
24
+ }
25
+
26
+ function layout (bytes32 slot ) internal pure returns (Layout storage $) {
27
+ assembly {
28
+ $.slot := slot
29
+ }
30
+ }
31
+ }
You can’t perform that action at this time.
0 commit comments