Skip to content

Commit

Permalink
Hash stealthMetaAddress in dataHash
Browse files Browse the repository at this point in the history
  • Loading branch information
garyghayrat committed Mar 22, 2024
1 parent cc2fa47 commit 163afc3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/ERC6538Registry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ contract ERC6538Registry {
DOMAIN_SEPARATOR(),
keccak256(
abi.encode(
ERC6538REGISTRY_ENTRY_TYPE_HASH, schemeId, stealthMetaAddress, nonceOf[registrant]++
ERC6538REGISTRY_ENTRY_TYPE_HASH,
schemeId,
keccak256(stealthMetaAddress),
nonceOf[registrant]++
)
)
)
Expand Down
7 changes: 6 additions & 1 deletion test/ERC6538Registry.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ contract ERC6538RegistryTest is Test, Deploy {
uint256 _nonce
) public view returns (bytes memory _signature) {
bytes32 _dataHash = keccak256(
abi.encode(registry.ERC6538REGISTRY_ENTRY_TYPE_HASH(), _schemeId, _stealthMetaAddress, _nonce)
abi.encode(
registry.ERC6538REGISTRY_ENTRY_TYPE_HASH(),
_schemeId,
keccak256(_stealthMetaAddress),
_nonce
)
);
bytes32 _hash = keccak256(abi.encodePacked("\x19\x01", registry.DOMAIN_SEPARATOR(), _dataHash));
(uint8 v, bytes32 r, bytes32 s) = vm.sign(_registrantPrivateKey, _hash);
Expand Down

0 comments on commit 163afc3

Please sign in to comment.