Skip to content

Commit

Permalink
validate bytecode hex input
Browse files Browse the repository at this point in the history
  • Loading branch information
merklejerk committed Jun 15, 2024
1 parent e6f65e8 commit c11750d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/routes/(app)/player/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@
if (!code.startsWith('0x')) {
code = `0x${code}`;
}
if (!/^0x[a-f0-9]$/i.test(code)) {
throw new UserError('Invalid bytecode hex.');
}
const hexCode = code as Hex;
const codeHash = keccak256(hexCode);
const encrypted = await encryptPlayerCode(
Expand Down

0 comments on commit c11750d

Please sign in to comment.