Skip to content

Commit

Permalink
add target length prefix for target->domain index
Browse files Browse the repository at this point in the history
peterjah committed Dec 31, 2024
1 parent 8f95f8f commit 1cd4608
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion smart-contract/assembly/contracts/main.ts
Original file line number Diff line number Diff line change
@@ -119,7 +119,10 @@ function domainToTargetKey(domainBytes: StaticArray<u8>): StaticArray<u8> {
function targetToDomainKeyPrefix(
targetBytes: StaticArray<u8>,
): StaticArray<u8> {
return DOMAIN_SEPARATOR_KEY.concat(ADDRESS_KEY_PREFIX_V2.concat(targetBytes));
const lenPrefix = StaticArray.fromArray([<u8>targetBytes.length]);
return DOMAIN_SEPARATOR_KEY.concat(
ADDRESS_KEY_PREFIX_V2.concat(lenPrefix).concat(targetBytes),
);
}

function targetToDomainKey(

0 comments on commit 1cd4608

Please sign in to comment.