@@ -114,7 +114,7 @@ contract Sig712Utils {
114
114
} else if (_action == MetaAction.SET_HINTS) {
115
115
return keccak256 ("SetHintsSigned(address namespace,bytes32 list,bytes32[] keys,bytes32[] values,address signer,uint256 nonce) " );
116
116
} else if (_action == MetaAction.SET_HINTS_WITH_METADATA) {
117
- return keccak256 ("SetHintsSigned(address namespace,bytes32 list,bytes32[] keys,bytes32[] values,bytes[] _metadata ,address signer,uint256 nonce) " );
117
+ return keccak256 ("SetHintsSigned(address namespace,bytes32 list,bytes32[] keys,bytes32[] values,bytes[] metadata ,address signer,uint256 nonce) " );
118
118
} else if (_action == MetaAction.SET_HINT_METADATA) {
119
119
return keccak256 ("SetHintMetadataSigned(address namespace,bytes32 list,bytes32 key,bytes32 value,bytes metadata,address signer,uint256 nonce) " );
120
120
} else if (_action == MetaAction.SET_HINT_METADATA_DELEGATED) {
@@ -123,10 +123,10 @@ contract Sig712Utils {
123
123
return keccak256 ("SetHintDelegatedSigned(address namespace,bytes32 list,bytes32 key,bytes32 value,address signer,uint256 nonce) " );
124
124
} else if (_action == MetaAction.SET_HINT_DELEGATED_WITH_METADATA) {
125
125
return keccak256 ("SetHintDelegatedSigned(address namespace,bytes32 list,bytes32 key,bytes32 value,bytes metadata,address signer,uint256 nonce) " );
126
- } else if (_action == MetaAction.SET_HINTS_DELEGATED) {
126
+ } else if (_action == MetaAction.SET_HINTS_DELEGATED) {
127
127
return keccak256 ("SetHintsDelegatedSigned(address namespace,bytes32 list,bytes32[] keys,bytes32[] values,address signer,uint256 nonce) " );
128
128
} else if (_action == MetaAction.SET_HINTS_DELEGATED_WITH_METADATA) {
129
- return keccak256 ("SetHintsDelegatedSigned(address namespace,bytes32 list,bytes32[] keys,bytes32[] values, bytes[] _metadata ,address signer,uint256 nonce) " );
129
+ return keccak256 ("SetHintsDelegatedSigned(address namespace,bytes32 list,bytes32[] keys,bytes32[] values, bytes[] metadata ,address signer,uint256 nonce) " );
130
130
} else if (_action == MetaAction.SET_LIST_STATUS) {
131
131
return keccak256 ("SetListStatusSigned(address namespace,bytes32 list,bool revoked,address signer,uint256 nonce) " );
132
132
} else if (_action == MetaAction.SET_LIST_OWNER) {
@@ -203,7 +203,7 @@ contract Sig712Utils {
203
203
_hint.list,
204
204
_hint.key,
205
205
_hint.value,
206
- _hint.metadata,
206
+ keccak256 ( _hint.metadata) ,
207
207
_signer,
208
208
_nonce
209
209
));
@@ -321,7 +321,7 @@ contract Sig712Utils {
321
321
_hint.list,
322
322
_hint.key,
323
323
_hint.value,
324
- _hint.metadata,
324
+ keccak256 ( _hint.metadata) ,
325
325
_signer,
326
326
_nonce
327
327
));
@@ -394,13 +394,18 @@ contract Sig712Utils {
394
394
* @return Hash of the SetHintDelegatedWithMetadata action
395
395
*/
396
396
function getSetHintsDelegatedWithMetadataStructHash (HintMetadataEntries calldata _hints , address _signer , uint _nonce ) internal pure returns (bytes32 ) {
397
+ bytes32 [] memory encodedMetadata = new bytes32 [](_hints.metadata.length );
398
+ for (uint i = 0 ; i < _hints.metadata.length ; i++ ) {
399
+ // Encode each metadata item
400
+ encodedMetadata[i] = keccak256 (_hints.metadata[i]);
401
+ }
397
402
return keccak256 (abi.encode (
398
403
getTypeHash (MetaAction.SET_HINTS_DELEGATED_WITH_METADATA),
399
404
_hints.namespace,
400
405
_hints.list,
401
406
keccak256 (abi.encodePacked (_hints.keys)),
402
407
keccak256 (abi.encodePacked (_hints.values)),
403
- keccak256 (abi.encode (_hints.metadata )),
408
+ keccak256 (abi.encodePacked (encodedMetadata )),
404
409
_signer,
405
410
_nonce
406
411
));
@@ -744,13 +749,18 @@ contract Sig712Utils {
744
749
* @return Hash of the SetHintsMetadata action
745
750
*/
746
751
function getSetHintsMetadataStructHash (HintMetadataEntries calldata _hints , address _signer , uint _nonce ) internal pure returns (bytes32 ) {
752
+ bytes32 [] memory encodedMetadata = new bytes32 [](_hints.metadata.length );
753
+ for (uint i = 0 ; i < _hints.metadata.length ; i++ ) {
754
+ // Encode each metadata item
755
+ encodedMetadata[i] = keccak256 (_hints.metadata[i]);
756
+ }
747
757
return keccak256 (abi.encode (
748
758
getTypeHash (MetaAction.SET_HINTS_WITH_METADATA),
749
759
_hints.namespace,
750
760
_hints.list,
751
761
keccak256 (abi.encodePacked (_hints.keys)),
752
762
keccak256 (abi.encodePacked (_hints.values)),
753
- keccak256 (abi.encode (_hints.metadata )),
763
+ keccak256 (abi.encodePacked (encodedMetadata )),
754
764
_signer,
755
765
_nonce
756
766
));
0 commit comments