-
Notifications
You must be signed in to change notification settings - Fork 6
Release to Master #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Release to Master #114
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
d0ec9ff
fix: toastify fix
kemuru 3fa6ef5
Merge pull request #106 from kleros/fix/toastify-fix
jaybuidl 1197bc2
chore(web): update-subgraph-status-lib
tractorss 38a1d7c
Merge pull request #107 from kleros/chore/update-subgraph-status-lib
kemuru 7c391f0
fix: pull updated kleroscore address by deployment and update arbitra…
kemuru 39989af
Merge pull request #109 from kleros/fix/pull-updated-kleroscore-addre…
jaybuidl a4a8f24
chore: bumped @kleros/kleros-v2-contracts, bumped hardhat/viem/wagmi
jaybuidl bed59c3
chore: devnet subgraph redeploy
jaybuidl 53b2e99
Merge pull request #110 from kleros/chore/arbitrator-contracts-update
jaybuidl 19e277d
fix(web): contract arbitrators in wagmi hook generation
jaybuidl ae9a027
fix: attachmentdisplay fix
kemuru 75d36f7
fix: hook fix
kemuru 9fc0510
Merge pull request #111 from kleros/fix(web)/wagmi-generate
kemuru dccaebe
fix: rolled back chai to v4 because v5 is ESM only
jaybuidl a7f4b01
fix: deployment-specific frontendUrl in dispute template
jaybuidl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,46 +1,28 @@ | ||
| import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
| import { | ||
| disputeTemplateRegistryConfig as devnetDtrConfig, | ||
| klerosCoreConfig as devnetCoreConfig, | ||
| } from "@kleros/kleros-v2-contracts/deployments/devnet.viem"; | ||
| import { | ||
| disputeTemplateRegistryConfig as mainnetDtrConfig, | ||
| klerosCoreNeoConfig as mainnetCoreConfig, | ||
| } from "@kleros/kleros-v2-contracts/deployments/mainnet.viem"; | ||
| import { | ||
| KlerosCore, | ||
| DisputeTemplateRegistry__factory, | ||
| KlerosCore__factory, | ||
| KlerosCoreNeo__factory, | ||
| KlerosCoreNeo, | ||
| DisputeTemplateRegistry, | ||
| } from "@kleros/kleros-v2-contracts/typechain-types"; | ||
| import { DeploymentName, getContractsEthers as _getArbitratorContracts } from "@kleros/kleros-v2-contracts"; | ||
| import { EscrowView, EscrowUniversal } from "../../typechain-types"; | ||
|
|
||
| const NETWORK_TO_DEPLOYMENT: Record<string, DeploymentName> = { | ||
| arbitrumSepoliaDevnet: "devnet", | ||
| arbitrumSepolia: "testnet", | ||
| arbitrum: "mainnetNeo", | ||
| } as const; | ||
|
|
||
| export const getArbitratorContracts = async (hre: HardhatRuntimeEnvironment) => { | ||
| const { ethers, deployments } = hre; | ||
| const networkName = deployments.getNetworkName(); | ||
| const deploymentName = NETWORK_TO_DEPLOYMENT[networkName]; | ||
| if (!deploymentName) | ||
| throw new Error( | ||
| `Unsupported network: ${networkName}. Supported networks: ${Object.keys(NETWORK_TO_DEPLOYMENT).join(", ")}` | ||
| ); | ||
| return await _getArbitratorContracts(ethers.provider, deploymentName); | ||
| }; | ||
|
|
||
| export const getContracts = async (hre: HardhatRuntimeEnvironment) => { | ||
| const { getChainId, ethers, config } = hre; | ||
| const chainId = Number(await getChainId()); | ||
| const { ethers } = hre; | ||
| const { klerosCore, disputeTemplateRegistry } = await getArbitratorContracts(hre); | ||
| const escrow = await ethers.getContract<EscrowUniversal>("EscrowUniversal"); | ||
| const view = await ethers.getContract<EscrowView>("EscrowView"); | ||
| let disputeTemplateRegistry: DisputeTemplateRegistry; | ||
| let klerosCore: KlerosCore | KlerosCoreNeo; | ||
| switch (chainId) { | ||
| case config.networks.arbitrum.chainId: | ||
| disputeTemplateRegistry = DisputeTemplateRegistry__factory.connect( | ||
| mainnetDtrConfig.address[chainId], | ||
| ethers.provider | ||
| ); | ||
| klerosCore = KlerosCoreNeo__factory.connect(mainnetCoreConfig.address[chainId], ethers.provider); | ||
| break; | ||
| case config.networks.arbitrumSepolia.chainId: | ||
| disputeTemplateRegistry = DisputeTemplateRegistry__factory.connect( | ||
| devnetDtrConfig.address[chainId], | ||
| ethers.provider | ||
| ); | ||
| klerosCore = KlerosCore__factory.connect(devnetCoreConfig.address[chainId], ethers.provider); | ||
| break; | ||
| default: | ||
| throw new Error(`Unsupported chainId: ${chainId}`); | ||
| } | ||
| return { escrow, view, disputeTemplateRegistry, klerosCore }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import React, { useEffect, useRef } from "react"; | ||
| import { useLocation, useNavigate } from "react-router-dom"; | ||
|
|
||
| import { useScrollTop } from "hooks/useScrollTop"; | ||
|
|
||
| const ScrollTop: React.FC = () => { | ||
| const scrollTop = useScrollTop(); | ||
| const { search, pathname } = useLocation(); | ||
| const navigate = useNavigate(); | ||
| const hasScrolled = useRef(false); | ||
|
|
||
| useEffect(() => { | ||
| if (hasScrolled.current) return; | ||
| const params = new URLSearchParams(search); | ||
| const section = params.get("section"); | ||
|
|
||
| if (section) { | ||
| const targetElement = document.getElementById(section); | ||
| if (targetElement) { | ||
| targetElement.scrollIntoView({ behavior: "smooth" }); | ||
| hasScrolled.current = true; | ||
| navigate(pathname, { replace: true }); | ||
| return; | ||
| } | ||
| } | ||
|
|
||
| scrollTop(); | ||
| }, []); | ||
|
|
||
| return null; | ||
| }; | ||
|
|
||
| export default ScrollTop; | ||
jaybuidl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import { useContext } from "react"; | ||
| import { OverlayScrollContext } from "context/OverlayScrollContext"; | ||
|
|
||
| export const useScrollTop = () => { | ||
| const osInstanceRef = useContext(OverlayScrollContext); | ||
|
|
||
| const scrollTop = (smooth = false) => { | ||
| osInstanceRef?.current | ||
| ?.osInstance() | ||
| ?.elements() | ||
| ?.viewport.scroll({ top: 0, behavior: smooth ? "smooth" : "auto" }); | ||
| }; | ||
|
|
||
| return scrollTop; | ||
| }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.