Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 7dfc298
Author: Daniel Wang <dan@taiko.xyz>
Date:   Tue Dec 12 16:46:17 2023 +0800

    add links in solidity files

commit 0ece27d
Author: Korbinian <KorbinianK@users.noreply.github.com>
Date:   Mon Dec 11 21:59:02 2023 +0100

    chore(bridge-ui-v2): update and fix typescript-linting (#15372)

commit 9ef2dd2
Author: Daniel Wang <99078276+dantaik@users.noreply.github.com>
Date:   Mon Dec 11 19:47:30 2023 +0800

    refactor(protocol): use Bridge to send cross-chain owned contract transactions (#15368)

    Co-authored-by: David <david@taiko.xyz>

commit 5e06cd9
Author: xiaodino <ruby@taiko.xyz>
Date:   Mon Dec 11 00:35:00 2023 -0800

    feat(bridge-ui-v2): Update encoded signal proof in BridgeProver.ts (#15348)

    Co-authored-by: David <david@taiko.xyz>
    Co-authored-by: Daniel Wang <99078276+dantaik@users.noreply.github.com>

commit 8edcb3c
Author: Daniel Wang <99078276+dantaik@users.noreply.github.com>
Date:   Mon Dec 11 15:17:52 2023 +0800

    chore(protocol): move eip1559_util.py to script/ (#15367)

commit 161f4c6
Author: Daniel Wang <99078276+dantaik@users.noreply.github.com>
Date:   Fri Dec 8 16:47:54 2023 +0800

    feat(protocol): Use taikoL2's address as the treasury address in circuits (#15350)

    Co-authored-by: David <david@taiko.xyz>

commit d50b276
Author: David <david@taiko.xyz>
Date:   Fri Dec 8 13:51:32 2023 +0800

    feat(protocol): grant `securityCouncil` the `PROPOSER` role (#15355)

commit 75b2ef9
Author: jeff <113397187+cyberhorsey@users.noreply.github.com>
Date:   Thu Dec 7 19:02:42 2023 -0800

    feat(guardian-prover-health-check): ui + api (#15324)

commit 06ce873
Author: Daniel Wang <99078276+dantaik@users.noreply.github.com>
Date:   Thu Dec 7 16:01:42 2023 +0800

    chore(protocol): apply fixes based on OZ's inspector reports (#15320)

commit 8fc51b4
Author: CeciliaZ030 <45245961+CeciliaZ030@users.noreply.github.com>
Date:   Thu Dec 7 05:32:31 2023 +0300

    fix(protocol): Non-recursive abi.encode for Zk Verifier (#15344)
  • Loading branch information
KorbinianK committed Dec 12, 2023
1 parent 1bdb5e8 commit 5fa8359
Show file tree
Hide file tree
Showing 183 changed files with 9,599 additions and 2,897 deletions.
94 changes: 88 additions & 6 deletions .github/workflows/guardianproverhealthcheck.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,101 @@
name: Guardianproverhealthcheck
name: guardian-prover-health-check

on:
push:
branches: [main]
paths:
- "packages/guardian-prover-health-check/**"
pull_request:
paths:
- "packages/guardian-prover-health-check/**"

jobs:
build:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
- uses: actions/setup-go@v3
with:
go-version: 1.21.0
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: latest

# Optional: working directory, useful for monorepos
working-directory: ./packages/guardian-prover-health-check
args: --config=.golangci.yml --timeout=4m

test:
runs-on: ubuntu-latest
needs: lint
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.21.0"

- name: guardian-prover-health-check - Unit Tests
working-directory: ./packages/guardian-prover-health-check
run: go test `go list ./... | grep -v ./contracts | grep -v ./mock | grep -v ./cmd` -coverprofile=coverage.txt -covermode=atomic

- name: guardian-prover-health-check - Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./packages/guardian-prover-health-check/coverage.txt
flags: guardian-prover-health-check

push-docker-image:
# only push docker image on PR merge to main
if: ${{ github.event }} == 'push'
name: Build and push docker image
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}

- name: Login to GCR
uses: docker/login-action@v2
with:
registry: gcr.io
username: _json_key
password: ${{ secrets.GCR_JSON_KEY }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
gcr.io/evmchain/guardian-prover-health-check
tags: |
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
type=sha
- name: Build and push
uses: docker/build-push-action@v2
with:
submodules: recursive
platforms: linux/amd64
push: true
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
PACKAGE=guardian-prover-health-check
101 changes: 0 additions & 101 deletions .github/workflows/guardianproverhealthcheck.yml

This file was deleted.

2 changes: 1 addition & 1 deletion packages/bridge-ui-v2/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ export SENTRY_AUTH_TOKEN=
# Config jsons in base64 (see ReadMe, these are generated via a script)
export CONFIGURED_BRIDGES=
export CONFIGURED_CHAINS=
export CONFIGURED_CUSTOM_TOKEN=
export CONFIGURED_CUSTOM_TOKENS=
export CONFIGURED_RELAYER=
export CONFIGURED_EVENT_INDEXER=
2 changes: 1 addition & 1 deletion packages/bridge-ui-v2/__mocks__/$env/static/public.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export const PUBLIC_WALLETCONNECT_PROJECT_ID = '123';
export const PUBLIC_SENTRY_DSN = 'https://sentry.com';
export const CONFIGURED_BRIDGES = '';
export const CONFIGURED_CHAINS = '';
export const CONFIGURED_CUSTOM_TOKEN = '';
export const CONFIGURED_CUSTOM_TOKENS = '';
export const CONFIGURED_RELAYER = '';
26 changes: 24 additions & 2 deletions packages/bridge-ui-v2/__mocks__/@wagmi/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,30 @@ export const fetchToken = vi.fn();

export const readContract = vi.fn();

export const configureChains = vi.fn(() => {
return { publicClient: 'mockPublicClient' };
const mockChains = [
{
id: 0,
name: 'Debug',
network: 'Debug',
nativeCurrency: {
name: 'ETH',
symbol: 'ETH',
decimals: 18,
},
rpcUrls: {
public: { http: ['some/url/'] },
default: { http: ['some/url/'] },
},
},
];

const mockPublicClient = () => {
return {};
};

export const configureChains = vi.fn().mockReturnValue({
chains: mockChains,
publicClient: mockPublicClient,
});

export const createConfig = vi.fn(() => {
Expand Down
4 changes: 2 additions & 2 deletions packages/bridge-ui-v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"@sveltejs/kit": "^1.27.4",
"@types/debug": "^4.1.12",
"@types/object-hash": "^3.0.6",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"@vitest/coverage-v8": "^0.33.0",
"@wagmi/cli": "^1.5.2",
"abitype": "^0.8.11",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function generateCustomTokenConfig() {
} else {
if (!process.env.CONFIGURED_CUSTOM_TOKENS) {
throw new Error(
'CONFIGURED_CUSTOM_TOKEN is not defined in environment. Make sure to run the export step in the documentation.',
'CONFIGURED_CUSTOM_TOKENS is not defined in environment. Make sure to run the export step in the documentation.',
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
// when the account is connected or disconnected via toast
function onAccountChange(newAccount: Account, oldAccount?: Account) {
if (newAccount?.isConnected) {
successToast({title: $t('messages.account.connected')});
successToast({ title: $t('messages.account.connected') });
} else if (oldAccount && newAccount?.isDisconnected) {
// We check if there was previous account, if not
// the user just hit the app, and there is no need
// to show the message.
warningToast({title: $t('messages.account.disconnected')});
warningToast({ title: $t('messages.account.disconnected') });
}
}
</script>
Expand Down
32 changes: 16 additions & 16 deletions packages/bridge-ui-v2/src/components/Bridge/Actions.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@
? typeof $tokenBalance === 'bigint'
? $tokenBalance > BigInt(0) // ERC721/1155
: 'value' in $tokenBalance
? $tokenBalance.value > BigInt(0)
: false // ERC20
? $tokenBalance.value > BigInt(0)
: false // ERC20
: false);
$: canDoNothing = !hasAddress || !hasNetworks || !hasBalance || !$selectedToken;
Expand All @@ -144,10 +144,10 @@
$selectedToken?.type === TokenType.ERC20
? isSelectedERC20 && $enteredAmount && !$insufficientAllowance && !$validatingAmount
: $selectedToken?.type === TokenType.ERC721
? allTokensApproved
: $selectedToken?.type === TokenType.ERC1155
? allTokensApproved
: false;
? allTokensApproved
: $selectedToken?.type === TokenType.ERC1155
? allTokensApproved
: false;
$: {
checkTokensApproved();
Expand All @@ -158,10 +158,10 @@
$selectedToken?.type === TokenType.ERC20
? canDoNothing || $insufficientBalance || $validatingAmount || approving || isTokenApproved || !$enteredAmount
: $selectedToken?.type === TokenType.ERC721
? allTokensApproved || approving
: $selectedToken?.type === TokenType.ERC1155
? allTokensApproved || approving
: approving;
? allTokensApproved || approving
: $selectedToken?.type === TokenType.ERC1155
? allTokensApproved || approving
: approving;
$: isERC20 = $selectedToken?.type === TokenType.ERC20;
$: isERC721 = $selectedToken?.type === TokenType.ERC721;
Expand All @@ -187,12 +187,12 @@
$: disableBridge = isERC20
? !erc20ConditionsSatisfied
: isERC721
? !erc721ConditionsSatisfied
: isERC1155
? !erc1155ConditionsSatisfied
: isETH
? !ethConditionsSatisfied
: commonConditions;
? !erc721ConditionsSatisfied
: isERC1155
? !erc1155ConditionsSatisfied
: isETH
? !ethConditionsSatisfied
: commonConditions;
</script>

{#if oldStyle}
Expand Down
4 changes: 2 additions & 2 deletions packages/bridge-ui-v2/src/components/Bridge/Amount.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@
? $tokenBalance
: BigInt(0) // ERC721/1155
: 'value' in $tokenBalance && $tokenBalance.value > BigInt(0)
? $tokenBalance.value
: BigInt(0) // ERC20
? $tokenBalance.value
: BigInt(0) // ERC20
: BigInt(0);
$: if (inputBox && sanitizedValue !== inputBox.getValue()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
} catch (err) {
console.error(err);
if (err instanceof SwitchChainError) {
warningToast({title: $t('messages.network.pending')});
warningToast({ title: $t('messages.network.pending') });
} else if (err instanceof UserRejectedRequestError) {
warningToast({title: $t('messages.network.rejected')});
warningToast({ title: $t('messages.network.rejected') });
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
function connectWallet() {
if (web3modalOpen) return;
web3modal.openModal();
web3modal.openModal();
}
function onWeb3Modal(state: { open: boolean }) {
Expand All @@ -31,7 +31,10 @@
</script>

{#if connected}
<Button class="hidden sm:flex pl-[14px] pr-[20px] h-[38px] mr-[8px] rounded-full" type="neutral" on:click={connectWallet}>
<Button
class="hidden sm:flex pl-[14px] pr-[20px] h-[38px] mr-[8px] rounded-full"
type="neutral"
on:click={connectWallet}>
<span class="body-regular f-items-center">
<svelte:component this={EthIcon} size={20} />
{#if $ethBalance >= 0}
Expand Down
Loading

0 comments on commit 5fa8359

Please sign in to comment.