We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6789092 commit 13863afCopy full SHA for 13863af
packages/ui/src/solidity/remix.ts
@@ -1,8 +1,15 @@
1
export function remixURL(code: string, upgradeable = false): URL {
2
const remix = new URL('https://remix.ethereum.org');
3
- remix.searchParams.set('code', btoa(code).replace(/=*$/, ''));
+
4
+ const codeWithEscapedSpecialCharacters = Array.from(new TextEncoder().encode(code), b => String.fromCharCode(b)).join(
5
+ '',
6
+ );
7
8
+ remix.searchParams.set('code', btoa(codeWithEscapedSpecialCharacters).replace(/=*$/, ''));
9
10
if (upgradeable) {
11
remix.searchParams.set('deployProxy', upgradeable.toString());
12
}
13
14
return remix;
15
0 commit comments