Skip to content

Commit a1e9c0b

Browse files
committed
Update remix code param encoding
1 parent 8a4840e commit a1e9c0b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/ui/src/solidity/remix.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
export function remixURL(code: string, upgradeable = false): URL {
22
const remix = new URL('https://remix.ethereum.org');
33

4-
const codeWithEscapedSpecialCharacters = Array.from(new TextEncoder().encode(code), b => String.fromCharCode(b)).join(
5-
'',
6-
);
4+
const encodedCode = btoa(String.fromCharCode(...new TextEncoder().encode(code))).replace(/=*$/, '');
75

8-
remix.searchParams.set('code', btoa(codeWithEscapedSpecialCharacters).replace(/=*$/, ''));
6+
remix.searchParams.set('code', encodedCode);
97

108
if (upgradeable) {
119
remix.searchParams.set('deployProxy', upgradeable.toString());

0 commit comments

Comments
 (0)