Skip to content

Commit

Permalink
Merge branch 'main' into OZ-notes
Browse files Browse the repository at this point in the history
  • Loading branch information
adaki2004 authored May 2, 2024
2 parents ed5f973 + 811fecb commit 5a18df3
Show file tree
Hide file tree
Showing 11 changed files with 11,108 additions and 8,637 deletions.
26 changes: 13 additions & 13 deletions packages/bridge-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@
"devDependencies": {
"@playwright/test": "^1.43.1",
"@sveltejs/adapter-auto": "^3.2.0",
"@sveltejs/adapter-static": "^2.0.3",
"@sveltejs/kit": "^1.30.4",
"@sveltejs/kit": "^2.5.7",
"@sveltejs/vite-plugin-svelte": "^3.1.0",
"@types/debug": "^4.1.12",
"@types/object-hash": "^3.0.6",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.7.0",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"@vitest/coverage-v8": "^1.4.0",
"@wagmi/cli": "^2.1.4",
"abitype": "^1.0.2",
"ajv": "^8.12.0",
"autoprefixer": "^10.4.18",
"daisyui": "^4.7.2",
"daisyui": "^4.10.3",
"dotenv": "^16.4.5",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -45,23 +45,23 @@
"lokijs": "^1.5.12",
"postcss": "^8.4.38",
"prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.2.2",
"svelte": "^4.2.12",
"svelte-check": "^3.6.9",
"prettier-plugin-svelte": "^3.2.3",
"svelte": "^4.2.15",
"svelte-check": "^3.7.0",
"tailwindcss": "^3.4.3",
"ts-morph": "^19.0.0",
"tslib": "^2.6.2",
"typescript": "^5.4.3",
"vite": "^4.5.3",
"vite": "^5.2.10",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^0.32.4",
"vitest": "^1.5.3",
"vitest-fetch-mock": "^0.2.2",
"vitest-mock-extended": "1.3.1"
},
"type": "module",
"dependencies": {
"@wagmi/connectors": "^4.1.18",
"@wagmi/core": "^2.8.0",
"@wagmi/connectors": "^4.3.1",
"@wagmi/core": "^2.8.1",
"@walletconnect/ethereum-provider": "^2.12.2",
"@walletconnect/modal": "^2.6.2",
"@web3modal/wagmi": "^4.1.11",
Expand All @@ -71,7 +71,7 @@
"debug": "^4.3.4",
"events": "^3.3.0",
"object-hash": "^3.0.0",
"svelte-i18n": "^3.7.4",
"svelte-i18n": "^4.0.0",
"viem": "^2.9.29"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,8 @@

<script lang="ts">
import { SvelteToast } from '@zerodevx/svelte-toast';
import type { SvelteToastOptions } from '@zerodevx/svelte-toast/stores';
const options: SvelteToastOptions = {
const options = {
duration: toastConfig.duration,
};
</script>
Expand Down
29 changes: 29 additions & 0 deletions packages/bridge-ui/src/tests/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,32 @@ import dotenv from 'dotenv';
dotenv.config({ path: './.env.test' });

vi.mock('@wagmi/core');

// Source: https://github.com/vitest-dev/vitest/issues/4043#issuecomment-1905172846
// This snippet is needed in order to support Uint8Array with vitest and jsdom.
if (process.env.VITEST === 'true') {
class ESBuildAndJSDOMCompatibleTextEncoder extends TextEncoder {
constructor() {
super();
}

encode(input: string) {
if (typeof input !== 'string') {
throw new TypeError('`input` must be a string');
}

const decodedURI = decodeURIComponent(encodeURIComponent(input));
const arr = new Uint8Array(decodedURI.length);
const chars = decodedURI.split('');
for (let i = 0; i < chars.length; i++) {
arr[i] = decodedURI[i].charCodeAt(0);
}
return arr;
}
}

Object.defineProperty(global, 'TextEncoder', {
value: ESBuildAndJSDOMCompatibleTextEncoder,
writable: true,
});
}
4 changes: 2 additions & 2 deletions packages/bridge-ui/svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/kit/vite';
import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';

/** @type {import('@sveltejs/kit').Config} */
const config = {
Expand Down
4 changes: 2 additions & 2 deletions packages/bridge-ui/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { sveltekit } from '@sveltejs/kit/vite';
import dotenv from 'dotenv';
import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';
import { defineProject } from 'vitest/dist/config';

import { generateBridgeConfig } from './scripts/vite-plugins/generateBridgeConfig';
import { generateChainConfig } from './scripts/vite-plugins/generateChainConfig';
Expand All @@ -13,7 +13,7 @@ if (process.env.NODE_ENV === 'test') {
dotenv.config({ path: './.env.test' });
}

export default defineProject({
export default defineConfig({
build: {
sourcemap: true,
},
Expand Down
63 changes: 0 additions & 63 deletions packages/protocol/contracts/team/airdrop/ERC721Airdrop.sol

This file was deleted.

55 changes: 55 additions & 0 deletions packages/protocol/genesis/mainnet.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
"use strict";
const ADDRESS_LENGTH = 40;

module.exports = {
contractOwner: "0xf8ff2AF0DC1D5BA4811f22aCb02936A1529fd2Be",
l1ChainId: 1,
chainId: 167000,
seedAccounts: [
{
"0x69AA0361Dbb0527d4F1e5312403Bd41788fe61Fe": 199,
},
{
"0x00000968bfe78aa27cd380d629d61c89bd6b03e8": 1,
},
],
get contractAddresses() {
return {
// ============ Implementations ============
// Shared Contracts
BridgeImpl: getConstantAddress(`0${this.chainId}`, 1),
ERC20VaultImpl: getConstantAddress(`0${this.chainId}`, 2),
ERC721VaultImpl: getConstantAddress(`0${this.chainId}`, 3),
ERC1155VaultImpl: getConstantAddress(`0${this.chainId}`, 4),
SignalServiceImpl: getConstantAddress(`0${this.chainId}`, 5),
SharedAddressManagerImpl: getConstantAddress(`0${this.chainId}`, 6),
BridgedERC20Impl: getConstantAddress(`0${this.chainId}`, 10096),
BridgedERC721Impl: getConstantAddress(`0${this.chainId}`, 10097),
BridgedERC1155Impl: getConstantAddress(`0${this.chainId}`, 10098),
// Rollup Contracts
TaikoL2Impl: getConstantAddress(`0${this.chainId}`, 10001),
RollupAddressManagerImpl: getConstantAddress(`0${this.chainId}`, 10002),
// ============ Proxies ============
// Shared Contracts
Bridge: getConstantAddress(this.chainId, 1),
ERC20Vault: getConstantAddress(this.chainId, 2),
ERC721Vault: getConstantAddress(this.chainId, 3),
ERC1155Vault: getConstantAddress(this.chainId, 4),
SignalService: getConstantAddress(this.chainId, 5),
SharedAddressManager: getConstantAddress(this.chainId, 6),
// Rollup Contracts
TaikoL2: getConstantAddress(this.chainId, 10001),
RollupAddressManager: getConstantAddress(this.chainId, 10002),
};
},
param1559: {
gasExcess: 1,
},
predeployERC20: false,
};

function getConstantAddress(prefix, suffix) {
return `0x${prefix}${"0".repeat(
ADDRESS_LENGTH - String(prefix).length - String(suffix).length,
)}${suffix}`;
}
2 changes: 1 addition & 1 deletion packages/protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"clean": "rm -rf abis cache* && forge clean",
"compile": "forge build --build-info --extra-output storage-layout",
"test:deploy": "./script/download_solc.sh && ./script/test_deploy_on_l1.sh",
"eslint": "pnpm exec eslint --ignore-path .eslintignore --ext .js,.ts .",
"eslint": "pnpm exec eslint --fix --ignore-path .eslintignore --ext .js,.ts .",
"fmt:sol": "forge fmt",
"generate:genesis": "ts-node ./utils/generate_genesis/main.ts",
"lint:sol": "forge fmt && pnpm solhint 'contracts/**/*.sol'",
Expand Down
Loading

0 comments on commit 5a18df3

Please sign in to comment.