@@ -29,9 +29,7 @@ abstract contract EIP712 {
29
29
* NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
30
30
* contract upgrade].
31
31
*/
32
- constructor (
33
- string memory name
34
- ) {
32
+ constructor (string memory name ) {
35
33
_name = name.toShortStringWithFallback (_nameFallback);
36
34
_hashedName = keccak256 (bytes (name));
37
35
}
@@ -62,9 +60,7 @@ abstract contract EIP712 {
62
60
* address signer = ECDSA.recover(digest, signature);
63
61
* ```
64
62
*/
65
- function _hashTypedDataV4 (
66
- bytes32 structHash
67
- ) internal view virtual returns (bytes32 ) {
63
+ function _hashTypedDataV4 (bytes32 structHash ) internal view virtual returns (bytes32 ) {
68
64
return ECDSA.toTypedDataHash (_domainSeparatorV4 (), structHash);
69
65
}
70
66
}
@@ -77,15 +73,11 @@ contract SignerECDSA is EIP712, Test {
77
73
"Permit(address signer,address sender,uint256 nonceNamespace,uint256 nonce,uint256 deadline,uint256 value,bytes data) "
78
74
);
79
75
80
- constructor (
81
- EthereumVaultConnector _evc
82
- ) EIP712 (_evc.name ()) {
76
+ constructor (EthereumVaultConnector _evc ) EIP712 (_evc.name ()) {
83
77
evc = _evc;
84
78
}
85
79
86
- function setPrivateKey (
87
- uint256 _privateKey
88
- ) external {
80
+ function setPrivateKey (uint256 _privateKey ) external {
89
81
privateKey = _privateKey;
90
82
}
91
83
@@ -119,19 +111,15 @@ contract SignerERC1271 is EIP712, IERC1271 {
119
111
"Permit(address signer,address sender,uint256 nonceNamespace,uint256 nonce,uint256 deadline,uint256 value,bytes data) "
120
112
);
121
113
122
- constructor (
123
- EthereumVaultConnector _evc
124
- ) EIP712 (_evc.name ()) {
114
+ constructor (EthereumVaultConnector _evc ) EIP712 (_evc.name ()) {
125
115
evc = _evc;
126
116
}
127
117
128
118
function _buildDomainSeparator () internal view override returns (bytes32 ) {
129
119
return keccak256 (abi.encode (_TYPE_HASH, _hashedName, block .chainid , address (evc)));
130
120
}
131
121
132
- function setSignatureHash (
133
- bytes calldata signature
134
- ) external {
122
+ function setSignatureHash (bytes calldata signature ) external {
135
123
signatureHash = keccak256 (signature);
136
124
}
137
125
@@ -163,31 +151,23 @@ contract EthereumVaultConnectorWithFallback is EthereumVaultConnectorHarness {
163
151
bool internal shouldRevert;
164
152
bool public fallbackCalled;
165
153
166
- function setExpectedHash (
167
- bytes calldata data
168
- ) external {
154
+ function setExpectedHash (bytes calldata data ) external {
169
155
expectedHash = keccak256 (data);
170
156
}
171
157
172
- function setExpectedValue (
173
- uint256 value
174
- ) external {
158
+ function setExpectedValue (uint256 value ) external {
175
159
expectedValue = value;
176
160
}
177
161
178
- function setShouldRevert (
179
- bool sr
180
- ) external {
162
+ function setShouldRevert (bool sr ) external {
181
163
shouldRevert = sr;
182
164
}
183
165
184
166
function clearFallbackCalled () external {
185
167
fallbackCalled = false ;
186
168
}
187
169
188
- fallback (
189
- bytes calldata data
190
- ) external payable returns (bytes memory ) {
170
+ fallback (bytes calldata data ) external payable returns (bytes memory ) {
191
171
if (shouldRevert) revert ("fallback reverted " );
192
172
193
173
if (expectedHash == keccak256 (data) && expectedValue == msg .value && address (this ) == msg .sender ) {
@@ -827,9 +807,7 @@ contract PermitTest is Test {
827
807
assertTrue (evc.fallbackCalled ());
828
808
}
829
809
830
- function test_Permit (
831
- uint256 privateKey
832
- ) public {
810
+ function test_Permit (uint256 privateKey ) public {
833
811
vm.assume (
834
812
privateKey > 0
835
813
&& privateKey < 115792089237316195423570985008687907852837564279074904382605163141518161494337
@@ -1329,9 +1307,7 @@ contract PermitTest is Test {
1329
1307
assertEq (evc.isAccountOperatorAuthorized (bob, operator), false );
1330
1308
}
1331
1309
1332
- function test_RevertIfInPermit_SetLockdownMode (
1333
- uint256 privateKey
1334
- ) public {
1310
+ function test_RevertIfInPermit_SetLockdownMode (uint256 privateKey ) public {
1335
1311
vm.assume (
1336
1312
privateKey > 0
1337
1313
&& privateKey < 115792089237316195423570985008687907852837564279074904382605163141518161494337
@@ -1358,9 +1334,7 @@ contract PermitTest is Test {
1358
1334
evc.permit (alice, address (this ), 0 , 1 , 1 , 0 , data, signature);
1359
1335
}
1360
1336
1361
- function test_RevertIfInPermit_SetPermitDisabledMode (
1362
- uint256 privateKey
1363
- ) public {
1337
+ function test_RevertIfInPermit_SetPermitDisabledMode (uint256 privateKey ) public {
1364
1338
vm.assume (
1365
1339
privateKey > 0
1366
1340
&& privateKey < 115792089237316195423570985008687907852837564279074904382605163141518161494337
0 commit comments